Linux operating systems (OS) have a secure, multi-user filesystem designed for efficient resource sharing and protection. Its directory structure, organized according to the Filesystem Hierarchy Standard (FHS), balances security and functionality by clearly separating user-accessible directories from those requiring administrative access.
Filesystem Hierarchy Standard (FHS)
The FHS, established in 1994, defines a standard layout for UNIX and UNIX-like systems. The hierarchy begins with a single primary root directory (/
), from which all other directories branch. This structure enables Linux systems to maintain order, accessibility, and security across both user and administrator resources.
Root Directory (/
)
The root directory (/
) is the top-level directory of the Linux filesystem. As the central point of the hierarchy, it branches to all other directories, even if they exist on separate physical devices. Only the root (administrator) user has permission to modify files and directories here, ensuring the integrity of essential system files.
Common Linux Sub-Directories
Each sub-directory within the Linux filesystem serves a specific function and often has unique access permissions. Here are some key sub-directories:
Directory | Purpose |
/bin | Common binary executables for all users |
/boot | Boot loader files |
/dev | Attached device files (e.g., USB, CD-ROM) |
/etc | Configuration files |
/home | Personal directories for each user |
/lib | System libraries |
/media | Mount points for removable devices |
/mnt | Temporary mount points for filesystems |
/opt | Optional software from vendors |
/proc | Virtual filesystem for system process information |
/root | Home directory for the root user |
/run | Runtime process information storage |
/sbin | System administration binaries |
/srv | Data for services offered by the system |
/sys | Virtual filesystem for hardware and drivers |
/tmp | Temporary files purged on reboot |
/usr | Read-only user programs and utilities |
/var | Variable files, including logs and temporary storage |
Linux vs. Other Filesystems: Windows and macOS
Transitioning from Windows
User Management: Unlike Linux's multi-user structure, Windows is typically a single-user system.
File Hierarchy: Windows organizes files by drive letters (e.g.,
C:\\WINDOWS
), while Linux uses a unified, tree-like structure branching from/
.Program Storage: Windows stores both system and application files in
C:\\Program Files
, while Linux separates these into dedicated directories (/bin
,/boot
,/usr/bin
).
Transitioning from macOS
Shared Heritage: As a UNIX-based system, macOS shares much of its core structure with Linux, starting from the root directory (
/
).Directory Names: Many Linux directories exist in macOS, though some have different names, like
/Users
instead of/home
for user directories.macOS-Specific Directories: macOS includes some unique directories such as
/Applications
,/Library
, and/System
.
Conclusion
The Linux filesystem, while unique, shares structural similarities with other operating systems, especially those with UNIX heritage. As you explore your Linux environment, you’ll gain familiarity with the directory purposes and their role in system operations.
And there you have it—our deep dive into the Linux Filesystem! We’ve explored the Filesystem Hierarchy Standard, unraveled the mysteries of the Root Directory, and peeked into its many subdirectories. These foundational concepts are essential to navigating and mastering Linux like a pro.
But wait, there’s more! In the next blog, we’re taking it up a notch by diving into File Permissions—because managing access rights is where the real power lies. So, stay tuned, and get ready to unlock another level of Linux mastery.
Until next time, keep coding, automating, and advancing in DevOps! 😁
Peace out ✌️