# Linux gurus:  question re: disappearing files/folders

**URL:** <https://boards.straightdope.com/t/linux-gurus-question-re-disappearing-files-folders/217032>\
**Category:** Factual Questions\
**Created:** [December 4, 2003, 9:47pm UTC](https://boards.straightdope.com/t/linux-gurus-question-re-disappearing-files-folders/217032 "2003-12-04T21:47:53Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![slortar](https://avatars.discourse-cdn.com/v4/letter/s/6bbea6/32.png) [@slortar](https://boards.straightdope.com/u/slortar)\
**Post date:** [December 4, 2003, 9:47pm UTC](https://boards.straightdope.com/t/linux-gurus-question-re-disappearing-files-folders/217032/1 "2003-12-04T21:47:53Z")

</div>

I’ve got a problem with a linux box running an oldish version of Redhat (it’s version 7). Some of my files and folders have disappeared. They still exist–the web server pulls the files and I can overwrite them just fine.\* I can cd to the folders from the command line (and most of their contents show up). However, they don’t show up in the listing when I ls or ftp in. Any ideas what the heck is going on?

- When I overwrite them, however, they still don’t show up in the directory listing.

---

<div class="post-metadata">

**Author:** ![Derleth](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@Derleth](https://boards.straightdope.com/u/Derleth)\
**Post date:** [December 4, 2003, 9:50pm UTC](https://boards.straightdope.com/t/linux-gurus-question-re-disappearing-files-folders/217032/2 "2003-12-04T21:50:40Z")

</div>

Do their names begin with a period, by any chance? ls usually doesn’t list names that begin with a dot, simply by old \*nix convention (such names have been reserved to important configuration files that would do well to be semi-hidden from the users).

Other than that, I’m pretty well stumped. But I’m by no means a `guru’.

---

<div class="post-metadata">

**Author:** ![slortar](https://avatars.discourse-cdn.com/v4/letter/s/6bbea6/32.png) [@slortar](https://boards.straightdope.com/u/slortar)\
**Post date:** [December 4, 2003, 10:08pm UTC](https://boards.straightdope.com/t/linux-gurus-question-re-disappearing-files-folders/217032/3 "2003-12-04T22:08:56Z")

</div>

Nope. Normal file names. Things like “images” or “news.txt” (minus the quotes, natch).

---

<div class="post-metadata">

**Author:** ![Revtim](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/revtim/32/1042_2.png) [@Revtim](https://boards.straightdope.com/u/Revtim)\
**Post date:** [December 4, 2003, 10:14pm UTC](https://boards.straightdope.com/t/linux-gurus-question-re-disappearing-files-folders/217032/4 "2003-12-04T22:14:03Z")

</div>

If you do “ls -l” there’s more shown. Maybe if you do that you’ll see more.

That’s the letter L lowercase after the dash.

---

<div class="post-metadata">

**Author:** ![Derleth](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@Derleth](https://boards.straightdope.com/u/Derleth)\
**Post date:** [December 4, 2003, 10:32pm UTC](https://boards.straightdope.com/t/linux-gurus-question-re-disappearing-files-folders/217032/5 "2003-12-04T22:32:09Z")

</div>

Try using `ls -l | less' (that is, `ls dash lowercase-ell pipe less’) just to see if you aren’t somehow missing some entries. I’m beginning to suspect some oddities in how your terminal is handling entries that just don’t fit.

If that doesn’t work, I’m well and truly stumped.

---

<div class="post-metadata">

**Author:** ![Terminus\_Est](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/terminus_est/32/3087_2.png) [@Terminus\_Est](https://boards.straightdope.com/u/Terminus_Est)\
**Post date:** [December 4, 2003, 11:17pm UTC](https://boards.straightdope.com/t/linux-gurus-question-re-disappearing-files-folders/217032/6 "2003-12-04T23:17:00Z")

</div>

What are the permissions of the subdirectory they exist in? You must have the ‘read’ bit set on a directory in order to list its contents. You can still access its contents, though, if it has the ‘execute’ bit set.

---

<div class="post-metadata">

**Author:** ![foxymoron](https://avatars.discourse-cdn.com/v4/letter/f/d26b3c/32.png) [@foxymoron](https://boards.straightdope.com/u/foxymoron)\
**Post date:** [December 4, 2003, 11:29pm UTC](https://boards.straightdope.com/t/linux-gurus-question-re-disappearing-files-folders/217032/7 "2003-12-04T23:29:29Z")

</div>

I second directory permissions. If you are accessing the files remotely using a web browser, it is probably being viewed by the uid/gid running the httpd process. This would be different than your uid/gid when your telnet/ssh/scp/ftp the files.

The user for httpd processes probably has permission to read the directory but you, the individual user, do not.

Worth looking into.

---

<div class="post-metadata">

**Author:** ![Revtim](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/revtim/32/1042_2.png) [@Revtim](https://boards.straightdope.com/u/Revtim)\
**Post date:** [December 4, 2003, 11:30pm UTC](https://boards.straightdope.com/t/linux-gurus-question-re-disappearing-files-folders/217032/8 "2003-12-04T23:30:26Z")

</div>

Ah, sounds like **Terminus Est** might have nailed it.

chmod \* +r

would fix that, right?

---

<div class="post-metadata">

**Author:** ![Terminus\_Est](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/terminus_est/32/3087_2.png) [@Terminus\_Est](https://boards.straightdope.com/u/Terminus_Est)\
**Post date:** [December 5, 2003, 12:11am UTC](https://boards.straightdope.com/t/linux-gurus-question-re-disappearing-files-folders/217032/9 "2003-12-05T00:11:34Z")

</div>

> [@](#):
>
> \*Originally posted by Revtim \*  
> \*\*chmod \* +r  
> \*\*

That would fix the permissions of the files _in_ the directory. What you want to do is fix the permissions of the _directory itself_.

$ chmod ugo+r /directory/name/here

Adjust “ugo” as appropriate to local security policy.

---

<div class="post-metadata">

**Author:** ![slortar](https://avatars.discourse-cdn.com/v4/letter/s/6bbea6/32.png) [@slortar](https://boards.straightdope.com/u/slortar)\
**Post date:** [December 5, 2003, 12:39am UTC](https://boards.straightdope.com/t/linux-gurus-question-re-disappearing-files-folders/217032/10 "2003-12-05T00:39:09Z")

</div>

Mystery solved. Sorta. Looks like we got freaking hacked. Now the feds have our server…luckily we’ve got a replacement with updated OS on the way that should be done overnight…with _cough_ the security holes hopefully plugged…

Anyway, thanks for the help–I really appreciated it.

---

<div class="post-metadata">

**Author:** ![leenmi](https://avatars.discourse-cdn.com/v4/letter/l/f1d935/32.png) [@leenmi](https://boards.straightdope.com/u/leenmi)\
**Post date:** [December 5, 2003, 2:12am UTC](https://boards.straightdope.com/t/linux-gurus-question-re-disappearing-files-folders/217032/11 "2003-12-05T02:12:47Z")

</div>

You’re kidding, right? The box is important to you and you are hoping that it comes secure from the vendor? They don’t come secure from the vendor.

Take some proactive measures. It is not impossible to secure a web server. Not black magic, either. [cert.org](http://www.cert.org) can get you started.

You’ll never have a hack proof server if it accepts any input, but you can make it secure enough that hackers look for easier targets. If someone is determined to get into your box, and does, intrusion detection and forensic tools are important. Tools such as tripwire are a good start. Logging to remote machines (just send your message and log files somewhere else) is another good strategy.

If you are too overworked or not confident in your experience to secure a web server that is important to your business, hire a consultant.

But don’t rely on default settings to protect critical information. Security strategies like that keep script kiddies in bragging rights.
