Navigating the Linux File System Hierarchy : From Basic to Advanced

Mohamed Yassine Ben Said
3 min readOct 23, 2023

--

Linux File System Hierarchy

Mastering the fundamentals of the Linux hierarchy is a must for every user, but delving deeper elevates your professionalism. Here, you’ll discover a comprehensive guide spanning common basics you use daily to essential advanced concepts less frequently utilized but crucial for your expertise

Basic Directories:

1. / (Root): The top-level directory where the entire file system hierarchy begins.

2. /bin (Binary): Contains essential binary executables needed for system boot and repair.

3. /boot: Stores boot-related files, including the kernel and bootloader configurations.

4. /dev (Device): Contains special device files representing hardware components.

5. /etc (Etcetera): Holds system-wide configuration files governing the behavior of various programs and services.

6. /home: Where user home directories are located, each containing user-specific settings and data.

7. /lib (Library): Stores shared libraries critical for system and application functionality.

8. /media: Used for mounting removable media like USB drives and DVDs.

9. /mnt (Mount): Used for temporarily mounting external devices or file systems.

10. /opt (Optional): An optional directory for additional software packages.

Intermediate Directories:

11. /proc (Process Information): A virtual file system providing information about running processes and kernel parameters.

12. /root: The home directory for the system’s root user.

13. /run: Stores run-time variable data, such as process IDs. It resides in memory.

14. /sbin (System Binary): Contains system binaries used for system maintenance and repair.

15. /srv (Service): Stores data files for various services provided by the system.

16. /tmp (Temporary): The designated directory for temporary files, typically cleared on system reboot.

17. /usr (Unix System Resources): Holds user commands, libraries, and documentation, serving as a treasure trove for essential resources.

18. /var (Variable): Houses variable data, including logs, caches, and spool files that change during system operation.

Advanced Directories:

19. /lost+found: Used by the fsck (file system check) utility to recover corrupted files and fragments. Typically empty unless there’s an issue with the file system.

20. /lib64: On 64-bit systems, this directory contains 64-bit shared libraries. It’s similar in function to /lib but for 64-bit applications.

21. /sys (System): Provides a virtual file system interface to kernel parameters and information, allowing interaction with and configuration of various aspects of the kernel.

22. /snap: On systems using Snappy package management, this directory contains Snappy packages, including applications and their dependencies.

23. /etc/opt: Sometimes used for additional software configuration files when /opt is in use.

24. /etc/sysconfig: Contains system configuration files on some Linux distributions, particularly Red Hat-based systems.

25. /usr/local: Often used for locally-installed software not managed by the package manager.

26. /usr/include: Contains header files used for compiling software.

27. /usr/local/games: Stores locally installed games and entertainment software.

28. /usr/local/share/games: Used for locally installed game data, including levels, maps, and other game-related content.

29. /usr/share/locale: Contains localization data for various software and utilities.

30. /usr/local/share/locale: For locally installed localization data.

31. /usr/include: Contains C and C++ header files for development purposes.

32. /opt/bin: An optional directory for binary executables of software installed in the /opt directory.

33. /opt/lib: Stores libraries related to software installed in the /opt directory.

34. /opt/etc: Configuration files for software in the /opt directory.

35. /opt/share: Used for architecture-independent data associated with software in the /opt directory.

36. /etc/systemd/system: Contains unit files defining system services and targets on systems using systemd for initialization and service management.

37. /lib/modules: Holds loadable kernel modules used to extend kernel functionality.

38. /usr/share/fonts: Contains font files used by various applications and system components.

39. /usr/share/applications: Stores desktop files used by Linux desktop environments to list available applications and provide information about them.

Conclusion:

Mastering the Linux file system hierarchy, from fundamental directories like / and /bin to advanced ones such as /opt and /usr/local, empowers users and administrators. This comprehensive guide offers a roadmap for effective system management, underlining the importance of understanding each directory’s role and significance. By exploring these directories, you’ve taken a significant step towards becoming a proficient Linux user, administrator, or developer. With this knowledge, you can confidently navigate the complexities of the Linux ecosystem and unlock its full potential.

--

--

No responses yet