Now that we've got the basics of moving around using cd and listing directory contents using ls under control, let's start exploring other parts of the filesystem. Let's begin with an overview of every directory directly under the root filesystem, as specified by the FHS:
Location |
Purpose |
/bin/ |
Contains essential binaries (=tools) used by normal users |
/boot/ |
Contains files used in the boot process: kernel, initramfs, bootloader |
/dev/ |
Contains special files used to access devices |
/etc/ |
Default location for software configuration files |
/home/ |
Contains the home directories for normal users |
/lib/ |
Contains system libraries |
/lib64/ |
Contains 64bit system libraries |
/media/ |
Removable devices such as USB and DVDs can be found here |
/mnt/ |
Empty by default, can be used to mount other filesystems |
/opt/ |
Directory where optional software can be installed |
/proc/ |
Directory where information about processes is stored |
/root/ |
The home directory of the root user |
/run/ |
Contains variable data about run-time data, different each boot |
/sbin/ |
Contains essential sytem binaries (=tools) used by administrative users |
/srv/ |
Directory to place data to be served by the server |
/sys/ |
Contains information about the system, such as drivers and kernel features |
/tmp/ |
Directory intended for temporary files, often cleared on reboot (because it is stored in RAM, instead of on disk) |
/usr/ |
Contains non-essential files and binaries as read-only user data |
/var/ |
Contains variable files, such as logs |
While each and every top-level directory has an important function, there are a few we're going to examine more closely since we're undoubtedly going to encounter them in our shell scripting. These are /bin/, /sbin/, /usr/, /etc/, /opt/, /tmp/, and /var/.