Working with Hidden Files in Linux

Linux dedicated servers have a very easy system for making files hidden. In general this is not an ironclad security measure but can be used to prevent users from accidentally disturbing critical configuration directories or files. You might also use it to trim down directories to make only the files you actually need access to visible.

To make a file hidden in Linux, simply rename it with a “.” in front of the name. For example:

mv filename .filename

It will appear in your directory only if you use the “-a” in the list command:

ls -al

-rw-rw-r– 1 dss dss 0 2012-05-14 13:54 .filename

When users login to your server via FTP, you can tell your server to keep hidden files hidden from FTP users. For example, you can use the IgnoreHidden option in Proftpd, but keep in mind that files like .htaccess will also be hidden.

In pretty much every other way, hidden files and directories in Linux function just as they would if they were not hidden. You can copy, move, delete, and rename them just as you would normal files.