Lecture # 9 - Linux File System

Lecture # 9 - Linux File System

Linux File System, Structure, and Key Directories and their Purposes.

Linux File System and Structure:

The Linux file system, also known as the Linux directory structure or Linux filesystem hierarchy, is the organizational layout of files and directories on a Linux operating system. It follows a hierarchical structure and defines the locations and organization of various system and user files. Understanding the Linux file system is crucial for effectively navigating and managing files on a Linux system.

Linux File System Hierarchy – nepalisupport

Key Directories with Purposes:

  1. / (Root Directory):

    • The root directory is the top-level directory in the Linux file system hierarchy.

    • It contains all other directories and files on the system.

    • In Linux, all paths start from the root directory (/).

  2. /bin (Binary Binaries):

    • Contains essential binary executable files required for system boot and operation.

    • Common system utilities like ls, cp, mv, rm, etc., are located here.

  3. /boot:

    • Contains boot loader files and the Linux kernel.

    • Configuration files related to the boot process may also reside here.

  4. /dev (Device Files):

    • Contains device files representing hardware devices and pseudo-devices.

    • Each device in Linux is represented as a file, allowing interaction with hardware through file operations.

  5. /etc (Configuration Files):

    • Contains system-wide configuration files.

    • Configuration files for various services, applications, and system settings are stored here.

  6. /home:

    • Home directories for regular users are typically located here.

    • Each user has their own subdirectory within /home where they can store personal files and configurations.

  7. /lib and /lib64 (Libraries):

    • Contains shared libraries required by executable files in /bin and /sbin.

    • /lib typically contains 32-bit libraries, while /lib64 contains 64-bit libraries on 64-bit systems.

  8. /media:

    • Mount point for removable media devices such as USB drives, CDs, and DVDs.
  9. /mnt (Mount Point):

    • A generic mount point for mounting filesystems temporarily.

    • Often used for mounting external or remote filesystems.

  10. /opt (Optional):

    • Contains additional software packages installed on the system.

    • Typically used for installing software that is not part of the official distribution's package management system.

  11. /proc (Process Information):

    • A virtual filesystem that provides information about processes and system resources.

    • Information is presented in a hierarchical structure resembling a directory tree.

  12. /root:

    • Home directory for the root user (superuser).

    • Root user's personal files and configurations are stored here.

  13. /sbin (System Binaries):

    • Contains essential system administration binaries.

    • Commands used for system administration tasks are located here.

  14. /srv (Service Data):

    • Contains data files for services provided by the system.

    • Often used by web servers and other network services to store data served by the system.

  15. /sys (System):

    • A virtual filesystem that exposes kernel data structures and information about the system's hardware and drivers.
  16. /tmp (Temporary):

    • Contains temporary files created by system and users.

    • Files in this directory are typically deleted upon system reboot.

  17. /usr (User):

    • Contains user-related programs, libraries, documentation, and source code.

    • Similar to /bin and /lib, but contains non-essential binaries and libraries.

  18. /var (Variable):

    • Contains variable data files that are expected to grow or change in size over time.

    • Log files, spool directories, and temporary files for various services are stored here.