File System Hierarchy (Linux)
π The File System Hierarchy defines the directory structure and directory contents in Linux.
πIt organizes files logically so the operating system and users can easily find and manage data.
πIn Linux, everything is treated as a file, and all files are arranged in a tree structure starting from the root directory (/).
Root Directory /
Top-most directory in Linux
All other directories are created under /
Important Directories & Description
π/bin – Binary Executables
Essential user commands
Example: ls, cp, mv, cat
π/sbin – System Binaries
System administration commands
Example: reboot, shutdown, ifconfig
Mostly used by root user
π/etc – Configuration Files
System-wide configuration files
Example:
π/etc/passwd – user accounts
π/etc/fstab – file system mounts
π/home – User Home Directories
Personal directories for users
Example: /home/venu
Stores documents, downloads, settings
π/root – Root User Home
Home directory for root
Different from /
π/var – Variable Data
Frequently changing files
Example:
π/var/log – log files
π/var/spool – mail, print jobs
π/tmp – Temporary Files
Temporary files created by applications
Cleared automatically on reboot
π/usr – User Programs & Data
Installed software and libraries
Subdirectories:
π/usr/bin – user commands
π/usr/lib – libraries
π/usr/share – documentation
π/lib & /lib64 – Libraries
Shared libraries needed by /bin and /sbin
Kernel modules also stored here
π/boot – Boot Loader Files
Files required to boot the system
Example:
vmlinuz
initramfs
grub
π/dev – Device Files
Represents hardware devices as files
Example:
π/dev/sda – hard disk
π/dev/null
π/proc – Process Information
Virtual filesystem
Provides system & process info
Example:
π/proc/cpuinfo
π/proc/meminfo
π/sys – System Information
Interface to kernel and hardware
Used for device and driver info
π/mnt – Temporary Mount Point
Used for temporarily mounting filesystems
π/media – Removable Media
Mount point for USB, CD/DVD
π/opt – Optional Software
Third-party applications
Example: /opt/oracle
No comments:
Post a Comment