Linux File System

Index: Introduction / The Root Directory /root : The Root User’s Home /bin : Essential User Commands /sbin : System Admin Commands /dev : Device Files /var : Variable Data /mnt : Manual Mount Point /media : Auto-mounted Devices /usr : User Software & Libraries /opt : Optional Software /home : User Directories /proc : Process Information Conclusion Let’s Connect on LinkedIn Introdcution First, the Big Picture: The Linux file system is one of its most defining and elegant features. Linux organizes everything , files, folders, even hardware , in a tree-like structure, starting from a single point: the root directory /. Analogy: Your computer is a large building: / is the main entrance. Every room inside that building (like /home, /bin, /dev) has a specific function. Even your printer, USB, and keyboard are represented as "files" within this building, not because they’re literal text files, but because Linux treats everything (devices, settings, etc.) as files so they can be accessed uniformly. / The Root Directory The starting point of everything. All other directories stem from this. Scenario: It's as the trunk of a tree, and everything else is a branch. /root : Root User’s Home Home directory for the superuser (administrator). Not to be confused with /, they’re different. Scenario: You're working on a server and need to fix a critical error. You switch to the root user (sudo su), and your home folder becomes /root, where you might store scripts or logs only root should access. /bin - Essential User Commands Holds basic, essential command-line tools for all users. Examples: ls, cp, mv, ping, ps Scenario: You’re troubleshooting a system. Even in recovery mode (limited system), /bin commands are still available to inspect and fix issues. /sbin : System Admin Commands Like /bin, but for system-level tools used by admins. Examples: adduser, fdisk, ifconfig, iptables Scenario: You're configuring network settings, you’d use ifconfig or ip which lives in /sbin. /dev : Device Files Special files that represent hardware (USB, disk drives, terminals). Example: /dev/sda1 might be your hard drive’s first partition. Scenario: You insert a USB. Linux creates /dev/sdb1. Now, you can access your USB through that file. /var : Variable Data Files that change or grow over time (logs, emails, databases). Key folders: /var/log: System and application logs. /var/tmp: Temporary files that survive reboots. Scenario: Your web server is misbehaving. You check /var/log/httpd/error.log to see what went wrong. /mnt : Manual Mount Point Temporary mount point for attaching storage. Scenario: You attach an external drive and manually mount it: mount /dev/sdb1 /mnt /media : Auto-mounted Devices Used by automated tools to mount USBs, CDs, SD cards. Scenario: You plug in a USB and a folder /media/yourusername/USBNAME appears. Your files are inside. /usr : User Software & Libraries Not for user data, it contains system apps, libraries, documentation. Subfolders include: /usr/bin: User command-line tools. /usr/lib: Libraries for programs. /usr/share: Help files, man pages. Scenario: You install Python — its binaries might live in /usr/bin/python3, and help files in /usr/share/doc/python3. /opt : Optional Software For third-party applications not part of the core system. Scenario: You download and install Google Chrome. Instead of it cluttering system folders, it's installed in /opt/google/chrome. /home : User Directories Every regular user gets a folder inside /home. Scenario: You create a user "sarah". Her files are saved in /home/sarah, just like your Documents or Desktop folders in Windows. /proc : Process Information A virtual folder (not on disk) showing live system details. Examples: /proc/cpuinfo: Info about your CPU. /proc/1234/: Info about process with ID 1234. Scenario: You want to know what your system is doing in real-time. Instead of using Task Manager like in Windows, you look in /proc. Conclusion Linux’s file structure is a true testament to the power of organization. From the root directory to the user folders, each directory serves a specific function that keeps everything running smoothly. Let’s Connect on LinkedIn As I automate my journey into RHCE and Ansible, I’d love to connect with fellow learners and professionals. Feel free to reach out and join me as I share tips, resources, and insights throughout this 30-day challenge. cloudwhistler #30daysLinuxchallenge

Apr 8, 2025 - 15:21
 0
Linux File System

Index:

  • Introduction
  • / The Root Directory
  • /root : The Root User’s Home
  • /bin : Essential User Commands
  • /sbin : System Admin Commands
  • /dev : Device Files
  • /var : Variable Data
  • /mnt : Manual Mount Point
  • /media : Auto-mounted Devices
  • /usr : User Software & Libraries
  • /opt : Optional Software
  • /home : User Directories
  • /proc : Process Information
  • Conclusion
  • Let’s Connect on LinkedIn

Introdcution

First, the Big Picture:

The Linux file system is one of its most defining and elegant features.
Linux organizes everything , files, folders, even hardware , in a tree-like structure, starting from a single point: the root directory /.

Analogy: Your computer is a large building:
/ is the main entrance.
Every room inside that building (like /home, /bin, /dev) has a specific function.

Even your printer, USB, and keyboard are represented as "files" within this building, not because they’re literal text files, but because Linux treats everything (devices, settings, etc.) as files so they can be accessed uniformly.

/ The Root Directory

The starting point of everything.

All other directories stem from this.

Image description

Scenario: It's as the trunk of a tree, and everything else is a branch.

/root : Root User’s Home

Home directory for the superuser (administrator).

Not to be confused with /, they’re different.

Image description

Scenario: You're working on a server and need to fix a critical error. You switch to the root user (sudo su), and your home folder becomes /root, where you might store scripts or logs only root should access.

/bin - Essential User Commands

Holds basic, essential command-line tools for all users.

Examples: ls, cp, mv, ping, ps

/bin

Scenario: You’re troubleshooting a system. Even in recovery mode (limited system), /bin commands are still available to inspect and fix issues.

/sbin : System Admin Commands

Like /bin, but for system-level tools used by admins.
Examples: adduser, fdisk, ifconfig, iptables

/sbin

Scenario: You're configuring network settings, you’d use ifconfig or ip which lives in /sbin.

/dev : Device Files

Special files that represent hardware (USB, disk drives, terminals).

Example: /dev/sda1 might be your hard drive’s first partition.

/dev

Scenario: You insert a USB. Linux creates /dev/sdb1. Now, you can access your USB through that file.

/var : Variable Data

Files that change or grow over time (logs, emails, databases).

Key folders:

/var/log: System and application logs.

/var/tmp: Temporary files that survive reboots.

 /var

Scenario: Your web server is misbehaving. You check /var/log/httpd/error.log to see what went wrong.

/mnt : Manual Mount Point

Temporary mount point for attaching storage.

Scenario: You attach an external drive and manually mount it:
mount /dev/sdb1 /mnt

/media : Auto-mounted Devices

Used by automated tools to mount USBs, CDs, SD cards.

Scenario: You plug in a USB and a folder /media/yourusername/USBNAME appears. Your files are inside.

/usr : User Software & Libraries

Not for user data, it contains system apps, libraries, documentation.

Subfolders include:

/usr/bin: User command-line tools.

/usr/lib: Libraries for programs.

/usr/share: Help files, man pages.

/usr

Scenario: You install Python — its binaries might live in /usr/bin/python3, and help files in /usr/share/doc/python3.

/opt : Optional Software

For third-party applications not part of the core system.

Scenario: You download and install Google Chrome. Instead of it cluttering system folders, it's installed in /opt/google/chrome.

/home : User Directories

Every regular user gets a folder inside /home.

/home

Scenario: You create a user "sarah". Her files are saved in /home/sarah, just like your Documents or Desktop folders in Windows.

/proc : Process Information

A virtual folder (not on disk) showing live system details.

Examples:

  • /proc/cpuinfo: Info about your CPU.

  • /proc/1234/: Info about process with ID 1234.

/proc

Scenario: You want to know what your system is doing in real-time. Instead of using Task Manager like in Windows, you look in /proc.

Conclusion

Linux’s file structure is a true testament to the power of organization.

From the root directory to the user folders, each directory serves a specific function that keeps everything running smoothly.

Let’s Connect on LinkedIn

As I automate my journey into RHCE and Ansible, I’d love to connect with fellow learners and professionals. Feel free to reach out and join me as I share tips, resources, and insights throughout this 30-day challenge.

cloudwhistler #30daysLinuxchallenge