View the Most Wanted LQ Wiki articles.
LinuxQuestions.org > Linux Wiki > Dot file

From LQWiki

Jump to: navigation, search

Dot files or hidden files are files that have a name starting with a dot like .ssh and .gconf. They are not truely hidden, they only have a dot as the first part of their name. By convention however, programs that deal with the user should treat any filename starting with a dot as 'hidden' unless the user says otherwise. The uses of dot-files vary, but they should not be concidered truely hidden, or secure, despite the name of "hidden files".

This means that they are not included in the file list you get with an asterisk in the shell:

tweedleburg:~ # mkdir test
tweedleburg:~ # cd test
tweedleburg:~/test # touch .testfile
tweedleburg:~/test # touch file1
tweedleburg:~/test # ls -a
.testfile  file1
tweedleburg:~/test # ls *
file1
tweedleburg:~/test # 

As you see in the example above, the files .testfile and file1 exist, but only file1 is shown for ls *.


Programs (by convention) store their user-specific configuration in a dot file (or files) in the user's homedir. For example kde stores its settings in the directory .kde/ of the user's homedir.


Take care if you want to backup your home directory! Taking a backup with the command

tar cvzf backup.tar.gz *

will NOT save your dot files, better use

tar cvzf backup.tar.gz .

Share

Personal tools