Under unix-like systems, all directories contain two entries, .
and ..
, which stand for the directory itself and its parent respectively. These entries are not interesting most of the time, so ls
hides them, and shell wildcards like *
don't include them. More generally, ls
and wildcards hide all files whose name begins with a .
; this is a simple way to exclude .
and ..
and allow users to hide other files from listings. Other than being excluded from listings, there's nothing special about these files.
Unix stores per-user configuration files in the user's home directory. If all configuration files appeared in file listings, the home directory would be cluttered with files that users don't care about every day. So configuration files always begin with a .
: typically, the configuration file for the application Foo is called something like .foo
or .foorc
. For this reason, user configuration files are often known as dot files.
ls
and wildcards hide all files whose name begins with a.
; this is a simple way to exclude.
and..
and allow users to hide other files from listings." This sounds like the following: The concept of hiding files/directories that start with a dot has actually appeared to hide.
..
. But later, people realized that being able to hide some files/directories has a value in it and hence, they began to put a dot at the beginning of the files which they want to be hidden. Is that really the case or just a speculation? – Utku Oct 05 '15 at 14:17.
and..
but made a mistake. It's however possible that he was dissuaded from fixing it because some users found it useful, and the reason why user configuration files start with.
is definitely so that they don't clutter the output ofls
in the home directory. I think we have a question about this here but I can't find it, it may have been mistagged. – Gilles 'SO- stop being evil' Oct 05 '15 at 18:49$HOME
directory, so they'd be easily findable. As the number of user configuration files grew, "namespace pollution" was seen as a problem (why doesls
show me 17 configuration files, plus the 4 I care about?). So, it was decided to preface the user configuration files with a ".
", and causels
to default to not listing them. There arels -a
(list ALL) andls -A
(ALL except.
, and..
). This convention (don't list dotfiles) only applies tols
(and shell wildcards). Other tools see all the files all the time – waltinator Feb 07 '22 at 22:50