Hiding a file or directory under Linux

October 2016

When dealing with a PC, we need to have a look at various security options. If the particular PC is being used by more than one person, there is the issue of maintaining the confidentiality of users' files. Under Linux, it is possible to hide files. The user must name the files, and precede the file name with a full stop. For example .bash _ name, bash_ game etc. But one must be aware that in Linux this would not completely hide the files - they would still be visible in the Explorer tab.

To hide a file or directory in Linux, just give it a name preceded by a full stop (.).

For example:

. bash_history
. bash_profile
. ssh

Note that by doing so you are not really hiding the files, because by using the option "-a" from the lS command or by selecting "Show hidden files" in the Explorer tab of Gnome or KDE, you can see those files.

Related :

This document entitled « Hiding a file or directory under Linux » from CCM (ccm.net) is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the license, as this note appears clearly.