Operating Systems & Administration

[Day 1] 5. Linux File Structure

D
DITISS Admin
••4 min read

!5. Linux File Structure.png

Linux File Structure

In Linux, the file system follows a tree-like structure starting from the root directory, denoted by

/
. Every file and directory in the Linux system is organised under this root file structure.

Key Directories in Linux

  1. /boot directory:

    • Contains booting information.
    • The Linux kernel and initial RAM disk are stored here.
  2. /bin directory:

    • Stores essential binary files (executables).
    • Contains basic command executables like
      ls
      ,
      cat
      , etc.
  3. /sbin directory:

    • Contains binaries that only the superuser (root) can execute.
    • "S" stands for super (root user).
  4. /etc directory:

    • Holds configuration files for the system.
    • Contains settings for the hostname, users, networks, etc.
  5. /root directory:

    • Home directory for the root user.
  6. /home directory:

    • Contains home directories for users other than the root user.
    • For example, directories for users like "ditiss" and "sunbeam" are stored here, with appropriate permissions.
  7. /media directory:

    • Stores information about removable devices (e.g., pen drives, external hard disks).
  8. /mnt directory:

    • Used for manually mounting removable devices.
    • A sub-directory of
      /media
      .
  9. /tmp directory:

    • Stores temporary files. These files are deleted automatically when the system is turned off.
  10. /var directory:

    • Stores variable data files.
    • For example, log files, such as
      /var/log/messages
      , where the kernel logs system messages.
  11. /usr directory:

    • Stores user application data.
    • Sub-directories include:
      • bin
        : User binaries.
      • sbin
        : System binaries for administrative tasks.
      • lib
        : System libraries.
      • share
        : Documentation and shared resources for applications.
  12. /lib directory:

    • Contains system libraries used by executables in
      /bin
      and
      /sbin
      .
  13. /opt directory:

    • Stores data for third-party applications installed outside the default package management.
  14. /dev directory:

    • Stores device files. In Linux, even hardware devices (e.g., pen drives, printers) are treated as files.
  15. /proc directory:

    • Contains information about all running processes and system information.
    • This directory provides a virtual file system interface to kernel data structures.
  16. /sys directory:

    • Contains kernel module information and details about device drivers.

Special Directories

  • /dev, /proc, and /sys:
    • These directories exist only in RAM and are created dynamically during boot.
    • They are known as virtual directories or virtual file systems because they are not stored on the hard disk.

Path:

A path in Linux represents a file or directory’s unique location. Paths are separated by

/
.

Types of Paths

  1. Absolute Path:

    • Always starts from the root (
      /
      ).
    • Example:
      /home/ditiss/python/demos/demo01.py
      .
  2. Relative Path:

    • Starts from the current working directory.
    • Example: If you’re already in
      /home/ditiss
      , the relative path would be
      python/demos/demo01.py
      .

Read Next

8/26/2026

[Day 1] 6. User Interfacing

### **User Interfacing** In an operating system, there are two main types of interfaces through which users can interact with the system: 1. **G...

8/26/2026

[Day 1] 7. Some Basic Commands

### **Shell Information** - `echo $SHELL`: Displays the default shell of your system. --- ### **Directory and File Listing** - `ls`: Displ...