A Guide to the Linu...
 
Notifications
Clear all

A Guide to the Linux File System Hierarchy


(@cyberscribe)
Byte Beginner
Joined: 10 months ago
Posts: 26
Topic starter  

Hey everyone,

I thought it would be beneficial for newbies to have a refreshed guide on the Linux file system hierarchy. Understanding how Linux organizes its file system is crucial for navigating, managing, and securing Linux systems effectively. Let's go into the structure and purpose of key directories and files within Linux.

Root (/): The start of the file system hierarchy. All files and directories are under the root directory, even if they are stored on different physical or virtual devices.

/bin: Contains essential binary executables (programs) that are needed in single-user mode and to bring the system up or repair it.

/boot: Holds files needed to start up the system, including the Linux kernel, an initial RAM disk image (for drivers needed at boot time), and the bootloader.

/dev: This directory contains device nodes or files that represent hardware devices, such as hard drives, printers, and displays.

/etc: Home to system-wide configuration files. This directory holds the configuration files for all installed software and scripts to start or stop services.

/home: Contains the home directories of all users. Each user has a directory within /home for personal storage, configuration files, etc.

/lib: Contains shared library images required by the binaries in /bin and /sbin. These libraries provide common functionality to the system's programs.

/media: A mount point for removable media such as USB drives, CD-ROMs, etc. Modern systems may use /run/media/<username> for user-specific mount points.

/mnt: Temporary mount points for mounting filesystems manually.

/opt: Optional application software packages. A directory for installing unbundled software packages, each in its own subdirectory.

/proc: A virtual filesystem providing process and kernel information as files. In essence, it contains runtime system information (e.g., system memory, devices mounted, hardware configuration, etc.).

/sbin: Contains essential system binaries, i.e., utilities used for system maintenance at a higher privilege level.

/tmp: Temporary files created by system and users are stored here. These files are generally deleted on system reboot.

/usr: Considered the secondary hierarchy for read-only user data; contains the majority of user utilities and applications.

/var: Variable files—files whose content is expected to continually change during normal operation of the system, such as logs, spool files, and temporary e-mail files.

I hope this guide helps you navigate the Linux file system more effectively. Let me know if you have any questions or if there's anything else you'd like to know!


   
Quote
(@abhijeet)
Script Novice
Joined: 10 months ago
Posts: 36
 

Great info thanks!


   
ReplyQuote
Share: