FILE SYSTEM HIERARCHY – Directory Structure: RHEL 7
This article is about the High-Level Directory structure in Linux systems. Here we talk about how the mount points are used to describe the file system hierarchy in Linux.
If you’re going to learn about Linux or getting started to Linux environment we suggest you keep this directory structure in mind. Because In Linux everything is represented as a file including hardware program, the files are stored in a directory, and every directory contains a file with the tree structure. That called File System Hierarchy.
Linux uses single rooted, inverted tree-like file system hierarchy, and according to the FHS, the following mount point is the most important system/user directories in Linux. This is very important to know about Linux File System Hierarchy to manage a Linux Operating system and also to gain knowledge on the default directories which exist on the most of the UNIX/Linux Operating systems. The Similar Directory structure you’ll find in all the major Linux Operating Systems.
Suggestable Read: Red Hat Enterprise Linux 7 Installation Steps
Also Read: Linux Booting Process
Red Hat Enterprise Linux also follows the FHS standard file system hierarchy. And this file system hierarchy is described in man 7 hier(description of file system hierarchy). the most significant directories that will encounter on Red Hat Enterprise Linux.
Root Directory / (forward slash): The root Directory has no parent and is represented by a Forward Slash /
Root User – Home Directory (~) Tilde symbol and Normal-user home directory ($) this is standard symbols in Linux.
The path of the directory or file specifies the directory location and subdirectories path. The path names are mainly 2 types. They are:
Absolute and Relative Pathnames
Absolute path names
Begins with a forward slash
1. Complete “road map” to file location
2. Can be used anytime when you wish to specify a file name
Relative path names
1.Do not begin with a slash
2.Specify location relative to your current working
•Names may be up to 255 characters
•Can be used all characters except “/”
•Names are case sensitive
•Everything is a file including hardware.
•Every configuration data store as a text file.
•Small and single-purpose program.
•Ability to chain programs together to perform the complex task.
Linux File System Hierarchy : Directories Details and Path names.
|/||This is a top level directory. It is parent directory for all other directories, It is represented by the forward slash (/). This is called Root Directory|
it is home directory for the root user (superuser). It provides the working environment for the root user.Ex: C:\Documents and Settings\Administrator
It is the home directory for other users in Linux. It provides a working environment for other users (other than root).
Each home directory is owned by the user the directory is assigned to, with no access to other users.
|/boot||The /boot file system contains the Linux kernel, boot support files, and boot configuration files for Linux. Like vmlinuz (kernel)…. ntoskrnl|
Initrd (INITial Ram Disk) and
GRUB2 (GRand Unified Bootloader v2)…. boot.ini, ntldr
|/etc||Some common sub-directories are—systemd, default, lvm,|
and skel—which contain configuration files for systemd. That means it contains all configuration files Like /etc/passwd…. User info
/etc/resolv.conf… Preferred DNS
/etc/dhcpd.conf…. DHCP server
by default Softwares are installed in /usr directory (UNIX Sharable Resources). This file system is mounted read-only. Some of the important sub-directories under /usr are: /usr/lib, /usr/bin, /usr/sbin, /usr/local, /usr/include, /usr/share and /usr/src. ex: c:\program files
|/opt||This file system holds additional software installed on the system. A sub-directory is created for each installed software. It is optional directory for /usr|
It contains third party software’s
|/bin|| it contains commands used by all users|
|/sbin||it contains commands used by only Super User (root)|
(Super user’s binary files)
|/dev||it contains device files|
Like /dev/hda … for hard disk
/dev/cdrom … for cdrom Similar to devise manager of windows
|/proc|| it contain process files|
Its contents are not permanent, they keep changing
It is also called as Virtual Directory
Its file contain useful information used by OS
like /proc/meminfo … information of RAM/SWAP
/proc/cpuinfo … information of CPU
|/var||contains data that frequently changes while the system is operational. Files holding log, status, spool, lock, and|
other dynamic data are located in this file system. it is containing variable data like mails, log files ex: /var/log, /var/opt,/var/spool and /var/tmp.
|/mnt||This directory is used to mount a file system temporarily. It is empty by default|
|/media||This directory is used by the system to automatically mount removable media, such as floppy, CD, DVD, USB, and Zip drives. it contains all of the removable media like CD-ROM, pen drive|
|/lib|| it contains library files which are used by OS|
It is similar to dll files of windows. Library files in Linux are SO (shared object) files
Conclusion: Here you can find the default directories and their path details. If you know these details, then it is easy to understand the Linux architecture. Every Directory contains files and subdirectories.