Linux computers use the same main directories. When you know what each one holds, you know where to look on a computer that you have never used.
- /
- home← home directories of normal accounts
- root← home directory of root
- etc← settings files
- var
- log← log files
- tmp← temporary files
- usr
- bin← programs
What goes where
| Directory | Holds | Go there to |
|---|---|---|
/home | The home directories of normal accounts | Work with the files of an account |
/root | The home directory of root | (Only as root) |
/etc | Settings files for the computer and its programs | Read or change a setting |
/var/log | Log files | Find out what a program did |
/tmp | Temporary files | Keep a file for a short time |
/usr/bin | Programs | Find out if a program is installed |
Settings files: /etc
A settings file is a text file that tells a program how to work. /etc/hostname, which you read in the lesson "Paths", is one. Each line is often a name, =, and a value:
learner@tidepool:~$ cat /etc/shop/shop.conf
opening_time=08:00
currency=EURLog files: /var/log
A log file is a text file in which a program writes what it did, one line for each event. When something goes wrong, read the log file first:
learner@tidepool:~$ cat /var/log/shop.log
08:00:02 shop started
08:14:40 order 1001 savedPrograms: /usr/bin
In Chapter 1, a command was "the name of a program". The programs are files, and most of them are in /usr/bin:
learner@tidepool:~$ ls /usr/bin
... cat ... head ... ls ... whoami ...Temporary files: /tmp
All accounts can put files in /tmp. The files can be deleted when the computer restarts. Do not keep anything important there.