A file or directory with a name that starts with a dot, ., is hidden. A plain ls does not show it. tree does not show it either.
text
learner@tidepool:~/shop$ ls
orders prices.txt reports
learner@tidepool:~/shop$ ls -a
. .. .settings orders prices.txt reportsShow hidden items
| Line | Shows |
|---|---|
ls | Names that do not start with . |
ls -a | All names, also . and .. |
ls -A | All names, but not . and .. |
. and .. are the current directory and its parent. Each directory has them. They start with a dot, so -a shows them.
Put -a together with other flags. ls -la gives the long form with the hidden items.
Hidden is only a name
A hidden file is a normal file. You can read it, change it, and go into a hidden directory with cd. The dot only stops ls from showing it.
Programs keep their settings in hidden files, so that the settings do not fill your listings. Your home directory has some:
text
learner@tidepool:~$ ls -A
.bashrc .profile notes.txt shopThe chapter "Customize Your Shell" explains .bashrc and .profile.