Linux File System Hierarchy Structure
The Linux File System Hierarchy Structure or the Filesystem Hierarchy Standard (FHS) defines the directory structure and directory contents in Unix-like operating systems. It is maintained by the Linux Foundation.
- In the FHS, all files and directories appear under the root directory / (ROOT).
- Most of these directories exist in all UNIX operating systems;
- Every single file and directory starts from the root directory which is /.
- By default only root user has the right to write under this directory.
- Make sure don't confuse with / (ROOT) and root user / mean root file
- system and root user means /root .
2. /bin : Essential command binaries that need to be available in single-user mode; for all users, e.g., cat, ls, cp.
- Contains binary executables only
- All commands store in this directory which you need to use in single-user modes are located under this directory.
3. /boot : Store Boot loader files, e.g., kernels, initrd.
- Kernel initrd, vmlinux, grub files are stored under /boot
4. /dev : Store essential device files, e.g., /dev/null.
- These include terminal devices, usb, or any device attached to the system.
5. /etc : Store all configuration files.
- Contains configuration files required by all programs.
- Example: /etc/resolv.conf, /etc/httpd/conf/httpd.conf .
6. /home : Store Users’ home directories, containing saved files, personal settings, etc.
- Home directories for all users to store their personal files.
- example: /home/nirmal, /home/nks
7. /lib : Libraries essential for the binaries in /bin/ and /sbin/.
- Library filenames are either ld* or lib*.so.*
8. /media : Mount points for removable media such as CD-ROMs and others.
- Temporary mount directory for removable devices.
- Examples, /media/cdrom for CD-ROM; /media/floppy for floppy drives; /media/cdrecorder for CD writer
- Note : I'm using Centos 7 so it's showing /run/media , in ubuntu you will see /media/username etc.
9. /mnt : Temporarily mounted filesystems.
- Temporary mount directory where sysadmins can mount filesystems.
- By default this is blank directory you can mount any filesystem under this
10. /opt : Optional application software packages.
- Contains add-on applications from individual vendors like bitnami.
- like Xampp or any other software .
11. /sbin : Essential system binaries, e.g., fsck, init, route.
- Just like /bin, /sbin also store binary executables.
- The linux commands located under this directory are used typically by system administrator, for system maintenance purpose.
- Example: iptables, reboot, fdisk, ifconfig, swapon etc
12. /srv : Site-specific data served by this system, such as data and scripts for web servers, data offered by FTP servers, and repositories for version control systems.
13. /tmp : Directory that store temporary files created by system and users.
- Files under this directory are deleted when system is rebooted.
14. /usr : Store Secondary hierarchy for read-only user data; contains the majority of (multi-)user utilities and applications.
- Contains binaries, libraries, documentation, and source-code for second level programs.
- /usr/bin store binary files for user programs. If you can’t find a user binary under /bin, look under /usr/bin. For example: at, awk, cc, less, scp
- /usr/sbin store binary files for system administrators. If you can’t find a
- system binary under /sbin, look under /usr/sbin. For example: atd, cron, sshd, useradd, userdel
- /usr/lib store libraries for /usr/bin and /usr/sbin
- /usr/local store users programs that you install from source.
- /usr/src holds the Linux kernel sources, header-files and documentation.
15. /proc : Virtual filesystem providing process and kernel information as files. In Linux,
- Store all information about system process.
- This is a virtual filesystem with text information about all system resources.
- For example: /proc/uptime
No comments:
Post a Comment