It's a directory which holds the system binaries or mostly the admin tools. It's similar to /bin directory, except that /sbin programs required root password in order to be executed. Among the programs inside /sbin directory tools such as fdisk, fsck, reboot, depmod, runlevel and others. Check the figure 4 down bellow.
4. /etc
This is the nerve center of your system as it contains all system related configuration files. A 'configuration file' is defined as a local file which is used to control the operation of a program. It must be static and cannot be an binary. Among the contents of /etc directory are the following config files.
*
/etc/x11 - this file contains all the configuration for the X Window System.
*
/etc/apt - It's Debian's next generation front - end for the dpkg package manager. It provides the apt-get utility and APT dselect method that provides a simpler, safer way to install and upgrade packages.
*
/etc/apt/sources.list - It contains a list of apt-sources from which packages may be installed via APT.
Each of these config files can safely be viewed using
cat command like
cat /etc/apt/sources.list which is shown in figure 5 down bellow.
Figure 5: Content of /etc/apt/sources.list file
Figure source: /home/amar/Desktop/figure5.png
NOTE:
This article is proudly written using Linux Mint 18.2 Sonya with MATE desktop environment.
https://www.linuxmint.com/edition.php?id=239
5. /dev
The /dev directory contains the special device files for all devices. These devices are created during installation and later with the /dev/MAKEDEV script. Some of the files located within /dev directory are:
*
/dev/dsp - Digital Signal Processor - interface between software which produces sound and your soundcard.
*
/dev/hda - It is the master device IDE drive on the primary IDE controller.
6. /proc
Figure 6: The content of /proc directory
Figure source: /home/amar/Desktop/figure6.png
The /proc file-system contains a illusionary file-system. It does not exist on a disk. Instead, the kernel creates it in a memory. It is used to provide information about the system processes. Some of the more important files are:
*
/proc/1 - A directory with information about process number 1.
*
/proc/devices - List of device drivers configured into the current running kernel.
*
/proc/dma - Shows which DMA channels are being used at the moment.
* /proc/interrupts - Shows which interrupts are in use and how many of each of there have been. (See figure 7 down bellow)
Figure 7: Listing /proc/interrupts
Figure source: /home/amar/Desktop/figure7
Linux LPIC-1
Learn everything you need in order to pass Linux LPIC-1 exam to become Linux SysAdmin
7. /var
Figure 8: The content of /var/log directory
Figure source: /home/amar/Desktop/figure8.png
The /var directory contains data that is changed when the system is running normally. It is specific for each system. Some ot the important files are listed down bellow.
* /var/lib - Files that change while the system is running normally.
* /var/log - Log files from various programs, especially login (/var/log/wtmp) which logs all logins and logouts into the system. Syslog (var/log/messages) contains all kernel and system messages.
8. /tmp
Figure 9: The content of /tmp directory
Figure source: /home/amar/Desktop/figure9.png
This directory contains mostly files that are required temporarily. Many of these files are important for currently running programs and deleting them may result in system failure. For more about /tmp directory please check out the link down bellow in references.
Conclusion:
Knowing the Linux file-system hierarchy may not be so important as it seems, but as a Linux System administrator you always work with the common commands such as cp, cd, mkdir, ls, grep, tar and others, therefore is good to know in which directory (/bin) you can find them. The same case goes for /proc folder which is very important to know when working with system processes and etc. In the next part of Linux FS, we gonna take a look on the rest of Linux file-system hierarchy. Till then, Marry Christmas and I see you soon.
References:
1) The Linux File-system hierarchy
2) The root directory
3) The /bin directory
4) The /sbin directory
5) The /etc directory
6) The /dev directory
7) The /proc directory
8) The /var directory
9) The /tmp directory