Hiding a file or directory under Linux

July 2017

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


Published by netty5. Latest update on March 16, 2012 at 12:07 PM by Celia Gatward.
This document, titled "Hiding a file or directory under Linux," is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (ccm.net).