Linux file structure

The one big filesystem

Concepts:

  • shareable data – sharable between hosts
  • non-sharable data – nonshearable between hosts
  • variable data – changes without user interaction
  • static data – binaries, libraries, documents
  • filesystem hierarchy standard [FHS]

Structure

    root directory

  • / -> primary directory for the entire system
  • /bin -> essential executable programs, that must be usable in singel user mode
  • /boot -> files needed to boot the system, kernel, initrd or initframs images, boot conf
  • /dev -> device nodes, used to work with hardware and software devices
  • /etc -> system wide configuration items
  • /home -> home folder for personal settings and files
  • /lib -> libraries required by exe binaries in bin and sbin
  • /lib64 -> 64 bit libraries required by exe binaries in bin and sbin [both 32 and 64 bit exe]. Non FHS!
  • /media -> removable media mount point
  • /mnt -> temporarily mounted filesystem
  • /opt -> optional application
  • /proc -> virtual pseudo filesytem giving information about the system nad the processes
  • /sys -> virtual pseudo filesytem, like proc. non FHS!
  • /root -> home dir for the root user
  • /sbin -> essential system binaries
  • /srv -> site specific data server by system.
  • /tmp -> temp files, lost on reboot
  • /usr -> multi user applications, utilities and data
  • /var -> variable data that changes while system is operatin

Examples:

  • estimate disk usage: du
  • get all folders under root folder and theri size: du –max-depth=1 -hx /
  • check folder for current process [the numerical folders in /proc are dynamic folder processes]: ls -F 10