Linux Directory Structure Details

Linux Directory Structure :-

FHS, or File Hierarchy System, is what defines the file system structure on Linux but there are also a few directories that have not yet got a definition under this standard:-

/ – The Root Directory :-
On Linux, everything is found under the directory / which is also called the
root directory. like C:/ on Windows operating system but without any drive letters.

/bin – Essential User Binaries:-
This directory is home to the binaries or programs that are essentials to the system being mounted in single-user mode. Things like Google Chrome would be stored in the directory called /usr/bin, while the utilities and system programs, like a bash shell, are found in /bin.

/boot – Static Boot Files:-
In this, where the files needed to boot up our system are located, such as the kernel files and the GRUB boot loader. The configuration files, however, are in/etc.

/cdrom –Mount Point for CD-ROMs:-
In this directory doesn’t come under the FHS standard but is still to be found in most operating systems. It is a temporary location for when you insert a CD-ROM into your computer.

/dev – Device Files :-
Devices are exposed as files on Linux and in this directory has several special files that are representative of devices. These are not files in the way we know them but they look like they are.
For example, if you see /dev/sda, it is representing the initial SATA drive in our system. We will also find the pseudo devices here, virtual devices that don’t correspond to any hardware.

/etc – Configuration Files:-
Here the configuration files are found and these can be edited in any
text editor. However, only the configurations of the system are found here; if we have user-specific ones, that will be found in the user’s home directory.

/home – Home Folders :-
In this we will find a home folder for each of the users. This contains
the data files and configuration files specific to the user and each user can only write to their own home folder. If we want to modify others, we need elevated permissions, i.e. to become the root user.

/lib – Essential Shared Libraries :
It contain all the libraries that the binaries located in the /bin and /sbin need.

/lost+found – Recovered Files :-
Every file system has a lost and found directory; if our system were to crashed, at the next bootup, a file system check is performed. If corrupted files are found, they are put into the directory, giving you the chance to recover as much as it can.

/media – Removable Media:-
Here we can find subdirectories and this is where removable media that is connected to the system is mounted. For example, a DVD or USB. When each  is mounted, a new drive will appear, allowing you to access the media content.

/mnt – Temporary Mount Points :-
Here administrators mount temp file systems while we are using them.

/opt – Optional Packages :-
Here we can find subdirectories for software packages that are optional. It is generally used by software that doesn’t follow the rules of the standard FSH.

/proc – Kernel & Process Files :-
It is like the /dev directory as it contain no files that are standard; instead,
it has special files that are representative of process and system informations.

/root – Root Home Directory :-
This is the root user’s home directory. Note it is not located in /home/root,
only at /root, distinguishing itself from /, which is the root directory for the
system.

/run – Application State Files :-
It is quite new and its provides a place for applications to store their
transient files, like process IDs and sockets. These are not stored in /tmp
because that may be deleted from there.

/sbin – System Administration Binaries :-
Similar to /bin and contains binaries it is used for system administration by
the root user.

/selinux – SELinux Virtual File System:-
It is our particular Linux distro used SELinux as security. The
directory will contain the files needed by SELinux. If we are using Ubuntu and we will see this directory, it is a bug because Ubuntu does not use SELinux.

/srv – Service Data :-
Hera will find the “data for services provided by the system”. If,
for example, we are using the Apache HTTP server for our website, the
files for the website would be stored in this directory.

/tmp – Temporary Files :-
Here temporary application files are stored and are deleted when the
system is rebooted.

/usr – User Binaries & Read-Only Data :-
We find files and applications here that are used by users and not by the
system. For example, we would find applications that are not essential here,along with binaries that are not essential.

/var – Variable Data Files :-
Where /usr is only readable, /var is writable. Here we will find log files and
anything else that is normally written to /usr.

Total Page Visits: 3454 - Today Page Visits: 1

Leave a Reply