Linux Directory Structure

The layout of Linux Directory Structure is a Tree# where the root is named “/”, thus the name root directory. In the root directory, there exists several directories that are mandatory like /bin, /boot, /dev, /etc, /lib, /tmp, /usr, and /var, and those that are optional such as /home, /mnt, and /root.

/bin is used to store program binaries. Though by editing the PATH variable, #Linux will be able to find the binaries stored in the directories specified in the variable.

/boot is a directory that stores various files related to system startup such as EFI and Grub.

/dev stores device files, sockets, and named pipes.

/etc (et-see) stores system-wide configuration files including /etc/passwd which holds various user information in the system.

/lib is a directory where shared libraries located. The alternative place where the libraries could be found is at /usr/lib.

/tmp stores temporary files. Those files will be removed once the system shut down.

/usr is a directory that stores static, sharable, read-only data, sometimes even programs especially in a multi-user environment.

/var stores variable data such as logs, mail, and process specific files. Some programs located in /usr will put their results into /var in some circumstances.

/home is usually where the user’s home directory reside.

/mnt, or /media in some Linux distribution, will contain mount points for external storage devices.

/root contains configuration file for the root user.

#linux #operating-system #tree