Skip to content

Instantly share code, notes, and snippets.

@Driste
Last active January 31, 2017 21:03
Show Gist options
  • Save Driste/957323035bd6a68847f585cbb7c06038 to your computer and use it in GitHub Desktop.
Save Driste/957323035bd6a68847f585cbb7c06038 to your computer and use it in GitHub Desktop.
The descriptions of the Linux Directory Structure

The Linux Directory Structure

Common Standard Structure

╔ /
╠════ bin -> usr/bin
╠════ sbin -> usr/sbin
╠════ etc
╠═══╤ dev
║   ├──── tty
║   ├──── sda
║   ├──── urandom
║   └──── null
╠════ proc
╠═══╤ var
║   ├──── log
║   ├──── lib
║   ├──── mail
║   ├──── spool
║   ├──── lock
║   └──── tmp
╠════ tmp
╠════ usr
╠════ home
╠════ boot
╠════ lib -> usr/lib
╠════ lib64 -> usr/lib64
╠════ opt
╠════ mnt
╠════ media
╚════ srv
  • /bin/ - User Binaries

    • Contains Binary Executables
    • Common Linux commands you need to use in single-user modes
    • Commands used by all the users of the system
      • ps, ls, ping, grep, cp
  • /sbin/ - System Binaries

    • Also contains binary executables
    • Linux Comands typically used by the system admin, for system maintenance purpose
      • iptables, reboot, fdisk, ifconfig, swapon
  • /etc/ - Configuration Files

    • contains the configuration files required by all programs
    • Contains startup and shutdown shell scripts
      • /etc/logrotate.conf, /ete/resolv.conf
  • /dev/ - Device Files

    • Contains Device Files.
    • Includes terminal devices, usb, or and device attached to the system.
      • /dev/tty1/ /dev/usbmon0
  • /proc/ - Process Information

    • Contains information about the system process
    • Is a pseudo filesystem that contains information about running processes.
      • /proc/{pid} contains information about the process wuth that pid
    • Is also a virtual filesystem with text information about system resources
      • /proc/uptime
  • /var/ - Variable Files

    • Content of the files that are expected to grow can be found here.
      • System log files, packages and database files, emails, pint queues, lock files, temp files needed across reboots.
        • /var/log, /var/lib, /var/mail, /var/spool, /var/lock, /var/tmp
  • /tmp/ - Temporary Files

  • /usr/ - User Programs

  • /home/ - Home Directories

  • /boot/ - Boot Loader Files

  • /lib/ - System Libraries

  • /opt/ - Optional Add-on Applications

  • /mnt/ - Mount Directory

    • Temporary mount directory where admins can mount filesystems
      • mount /dev/sda5 /mnt/
  • /media/ - Removable Media Devices

    • Temporary mount directory for mounting removable devices.
      • mount /dev/cdrom /media/cdrom
  • /srv/ - Service Data

    • Contains Server specific service related data.
      • /srv/cvs contains CVS related data
  • /root/ - Root User's Home Directory

Resources

Linux File System Structure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment