Reference guide to Linux Directory structure
When we install a Linux distribution we see that a number of directories are created. These created directories may be same or partially different on various Linux distributions. You might know about the directory structures & what purpose they serve. For those of you who don’t know about the Linux directory structure or have partial knowledge or just want to relook on Linux directory structure & its usage, this article will act as a reference guide.
(Recommended Read: Linux Commands for Beginners (Part 1) )
(Also Read: Linux Commands for Beginners (Part 2) )
We will start out this article with the Linux directories/partitions that are must for every Linux system & are required for Linux system to work properly. These partitions are ‘/’ (root), ‘/boot’, ‘/swap’. Though the ‘/’ (root), ‘/boot’ partitions are absolutely required but a system might work without swap partition, but its recommended that we have one for our Linux system. So let’s start out with these Linux partitions & their purpose,
Linux Directory structure
‘/’ (root) – / or root partition is one of the most important partition for a Linux machine. This is the partition where all other Linux partitions are. So this is the basis of Linux directory structure.
‘/boot’- Another important partition, boot partition contains all the startup files, kernel files & VMLinuz. In the recent, new Linux distribution, it also holds the Grub data as well.
‘/swap’- Swap partition acts as a virtual memory/RAM for the system & is used when your system runs out of the physical RAM. Though usually it’s a separate partition, we can also use a file to act as swap space.
These are the minimum partitions that are required to run a Linux system. Below mentioned are other partitions in Linux directory structure,
‘/root’- This is the home directory/partition for the administrative user i.e. root.
‘/home’- This is the directory that contains the home directory for all users other than super user root.
‘/etc’- This partitions holds all the important configuration files for the system. Once can also compare this partition to control panel on Windows system.
‘/bin’- This directory contains the common programs that are shared among administrative users, common users & the system.
‘/sbin’- contains all the programs that are used by system & system administrator.
‘/initrd’- This directory contains the system library files, files for the system that are needed by system or other programs to run.
‘/mnt’- this directory acts as a default mount point for all external devices like usb storage device, CD-DVD rom etc.
‘/opt’- Its used as installation folder for extra software & 3rd party softwares.
‘/var’- This folder is the default storage for all the variable files created by users, like log files, mail queue etc. This folder also contains some temporary files.
‘/proc’- This virtual file system contains complete information regarding the system resources.
‘/tmp’- This partition acts as a temporary space for use by the system. Files are stored temporarily on this partition & are cleaned upon every reboot.
‘lost+found’- Every partition has a lost+found directory in its upper directory. This serves as a storage for those files that were saved during failures.
‘/misc’- This partition is used by system for miscellaneous purposes.
This is our article that will act as reference guide for Linux directory structure. Please feel free to send in any questions or queries you have using the comment box below. Suggestions are also welcome.