Earlier in the book, we talked about disk sharing using read-only files. Table 20-2 contains a more complete directory listing. Directories where content could potentially be read-only shared are marked in gray.
Directory structures vary with distribution.
Table 20-2. Typical Linux directory structure
Referred to as the "root" directory. The root directory normally contains all other directories. When a directory structure is displayed as a tree, the root directory is at the top. It is generally considered a bad idea to store single files in this directory.
Contains many important Linux commands such as the shells (ash, bash, and csh) and essential utilities such as grep, gzip, ping, and su. /usr/bin generally contains applications for system users. The distribution of programs between /bin and /usr/bin depends on the distribution.
Contains information needed at boot time, such as the Linux kernel.
Contains device definitions. In Linux, devices are treated as a file. Files in /dev/ serve as gateways to physical computer components such as a printer, modem hard disk, and so forth. Even your terminal is treated as a device file. A popular device is /dev/null, which is useful for sending output to be deleted.
Contains the configuration files for the Linux system. Most of these are text files and therefore are easy to edit. Although Linux distributions ship with configuration tools, editing the files manually in /etc is often necessary.
The top-level directory for users' home directories. For each user there is a separate directory within /home. If your user name is JOHN your home directory will be /home/john. You can always return to your home directory by typing "cd" at the shell prompt.
Contains shared libraries for programs that are dynamically linked.
Where Linux keeps any files it restores after a system crash or when a partition has not been unmounted before a system shutdown. It provides a means of recovering files that otherwise would have been lost.
Contains additional software. /opt is home for many large packages such as StarOffice, KDE, and Oracle.
Contains the process file system. /proc contains all the "virtual files" representing different aspects of your system such as your CPU, RAM, and so forth.
Contains programs that are reserved for the superuser and are needed to start the system.
Contains scripts used to start the system. These scripts are executed directly or indirectly by /sbin/init, the father of all processes.
Contains temporary files. Many applications use this directory to hold some information.
Contains user commands and applications. Also their source code, pictures, and documentation. /usr can be the largest directory on a Linux system. It can be useful to have this directory in a separate partition.
Contains files that change constantly when the system is running, such as log files and mail spools.