Hidden file and hidden directory - Wikipedia#Unix_and_Unix-like_environments
Unix and Unix-like environments
The Unix -based
lsshell command hides any file that starts with a dot (commonly called a dot file or dotfile) unless the option-aor-Ais specified.1 Even with wildcard matching, the command does not match a dotfile unless the expression starts with.For example,﹡f﹡does not match.foo, but.f﹡does.According to Rob Pike, dotfiles were an unintended consequence of the implementation of the hierarchical file system during the Unix 2nd Edition re-write, which introduced
.as a name in a directory that refers to the directory itself and..as a name in a directory that refers to its parent directory. In order to exclude those two entries fromlsoutput, all entries prefixed with.were omitted. This meant that any file or directory could be excluded from the output oflsby giving it a file name with.as the first character.2Commonly, user-specific application configuration information is stored in the user’s home directory as a dotfile. Notable dotfiles include startup shell scripts such as
.profile,.login, and.cshrcas well as.planand.projectwhich are used by thefingerandnamecommands.3 Many applications, from bash to desktop environments such as GNOME, store user-specific configuration this way, but the XDG Base Directory Specification aims to migrate such config files to be non-hidden (not starting with.) but stored in a hidden directory$HOME/.config.4
Printed 2026-10-13.
(echo:: @ ᯤ)
Footnotes
-
“ls(1) - Linux man page”. linux.die.net. Retrieved 2020-08-23. ↩
-
Rob Pike (August 3, 2012). “A lesson in shortcuts”. Google Plus. Archived from the original on 2014-12-05. ↩
-
One user could lookup another by using the command along with the username (and hostname if not on the local host), and the finger service would respond with the other user’s current status, and the contents of the
.planand.projectfiles in that user’s$HOMEfolder. ↩ -
Bastian, Waldo; Lortie, Ryan; Poettering, Lennart (November 24, 2010). “XDG Base Directory Specification”. Retrieved June 4, 2014. ↩