So I hope you people have successfully installed the Linux operating systems in your Virtual Machines. So now let's move to its file systems.
Linux File Hierarchy Structure:
The Linux File Hierarchy Structure defines the directory structure (or) the File hierarchy Standard (FHS) and the directory contents in the Unix like Operating systems. It was maintained by the Linux Foundation
- In this FHS, Even all the files are stored in the physical directory(or) the virtual devices, all the directories will appear in the root(/) directory.
- If certain subsystems were installed, some of these directories exist only in a particular system.
- In all the UNIX operating systems, most of the systems have the same directories and were generally used in the same way.
So let us discuss its hierarchy system in detailed.
1. Root(/):
It is the primary root directory of the entire file system
- Every directory and the file start at the root
- Only the root user has the right to write under this directory
Root users home directory is /root which is not equal to (/)
This root consists of the following files as shown below
2. bin:
This folder contains the essential Linux command binaries in a single user mode.
Ex: cat, ls, cp
- This contains the binary executable files
- This directory contains the common Linux commands in a single user mode
- Besides this directory also contains the commands used by the other users in the system.
Ex: ps, ls, cp, ping, grep.
3. boot
This directory contains the boot loader files
Ex: kernels, initrd
4. dev
This directory contains the essential device files. This includes the terminal devices, USB (or) any device attached to the system.
Ex: /dev, /tty1
5. etcThis directory contains the host-specific system-wide configuration files
- Moreover, this directory contains the configuration files required for all the files
- This also contains the start-up and start down shell scripts used to write the start/ stop individual programs.
Ex: /etc/resolv.conf, /etc/logrotate.conf
Click the link to know How can you become the DevOps engineer?
6. home
This directory contains the saved files (or) the personal settings etc...
This directory is used to store their personal files
Ex: /home/balajee
7. lib
This directory contains the essential libraries for libraries in /bin and /sbin.
These libraries can be either id* (or) lib*.so*.
Ex: id-2.11.1
8. media
this points to the removable disk such as CD- Roms.
- This is the mount directory for removable devices.
Ex: /media/ cdrom for CD- ROM, /media/floppy for floppy drivers.
9. mnt
This directory contains temporary file systems. This is a place where the sysadmins can mount the file systems
10. opt
This directory contains the optional application software packages. This contains the add - on applications from the individual vendors. These add-on applications can be installed under either /opt (or) /opt/sub-directory
11. sbin
This directory contains the essential system binaries
ex: fsck, init, and route
just like /bin, the /sbin also contains the binary executables.
ex: iptables, rebook, fdisk, ipconfig.
12. srv
This directory contains the system information such as the data and the scripts for the web servers, data offered for FTP Servers, and the repositories for Version Control System. This SRV usually stands for the service. This contains the CVS related data.
13. tmp
This directory contains the temporary files. And these were not preserved when the system reboots and the size may be severely restricted. Under this directory, both the systems and the users can create temporary files. When the system is rebooted, files under this directory were deleted.
14. usr
It is the secondary hierarchy for read-only data. This contains the majority of user utilities and applications.
- This contains the binaries, libraries, documentation and the source code for the secondary level programs.
- /usr/bin contains the binary files for the user programs. If you cant find a user under the /bin then we can find under /usr/bin.
- /usr/sbin contains the binary files for the system administrators. And if you cannot find the file under /sbin then it can be found at /usr/sbin
- /usr/lib contains the libraries for usr/bin and usr/sbin
- /usr/local contains the user programs that you can install from the source. For example, when you install apache from the source, it goes under /usr/local/apache2
- /usr/src holds the Linux kernel sources, header files, and documentation
15. proc
It is a virtual file system providing the process and the kernel information as files. This directory contains the automatically generated and populated system on the fly.
- This directory usually contains information about the processes.
- This pseudo-file system contains information about the running process
- This virtual file system which contains the text information about the system resources