Content
    Linux

Unix Directory Structure

Linux

See also the Filesystem Hierarchy Standard.

DirectoryContent
/bin/Essential commands and programs for all users
/sbin/System binaries: mainly system administration programs
/boot/Files for bootloader
/dev/Device files and other special files
/usr/System utilities (Unix System Resources)
/opt/Optional software: mainly for users
/etc/System configuration files
/home/User home directories
/root/Root home directory
/tmp/Temporary files, deleted regurarly (e.g. at reboot)
/kernel/The operating system
/srv/Data for services
/var/Variable files: logs, configs, settings
/usr/lib/Precompiled libraries (shared objects)
/lib/Precompiled libraries (shared objects)
/media/Removable devices are mounted here
/mnt/Temporary filesystems are mounted here
/proc/Virtual file system with live kernel information (procfs)
/sys/Virtual file system with live system information (sysfs)

Any directory ending with bin/ contains binary executable files (or links to them).

The /usr directory contains additional executables, libraries, and utilities for the system administrator. It contains the directories /usr/bin, /usr/lib and /usr/sbin.

/usr does not need to be on the root filesystem, therefore it cannot contain anything that is required for booting the system.

Procfs

The /proc file system is a pseudo filesystem that allows to get informations from the kernel.

The man page can be found with: man 5 proc

There are also informations available in the /sys file system.

Processes

Each running process has a subfolder in /proc which is named after its PID.

DirectoryContent
/proc/$pid/cmdlineThe command line that was used to start the process.
/proc/$pid/environThe environment of the process.
/proc/selfA link to the current process (can be used prom the process to get information about itself).
/proc/$pid/fd/A directory that contains references to file descriptors that the process uses.
/proc/$pid/statmInformation about the process memory.
/proc/$pid/statusGeneral formated information: PID, real and effective UID and GID, memory use, bitmasks …
/proc/$pid/statSame as /proc/$pid/status. But not formated.
/proc/$pid/cwdA symbolic link to the current working directory of the process.
/proc/$pid/exeA reference to the executable file of the process.
/proc/$pid/rootA link to the root directory of the process (s.a. chroot()).
/proc/$pid/mapsContains memory mappings to files and libraries used by the process. This file can become very large.

Kernel

  • The command that was used to run the kernel at boot time can be found with cat /proc/cmdline
  • More information about kernel parameters can be found with man bootparam
  • The current locks can be found under /proc/locks
  • Loaded kernel modules are listed under /proc/modules
  • Information about filesystems are found under /proc/filesystems and /proc/mounts

Processes and Hardware

procfs
DirectoryContent
/proc/devicesList devices (character- and block-devices), HD’s, SSD’s, ports …
/proc/dmaList of used DMA channesl and the driver that uses it.
/proc/interruptsList of used interrupts, type of IRQ, using modules and number of occureces
/proc/ioportsList of all used I/O port (HD’s, ethernet, USB …).
/proc/iomemMapped hardware memory regions.
/proc/statGeneral informations about processorS states (s.a. procinfo)
/proc/uptimeNumber of seconds that the system is running and idle time of CPU’s.
/proc/scsi/Directory with informations about SCSI devices
/proc/scsi/scsiList of all SCSI devices.
/proc/net/Directory with information to networks
/proc/loadavgAverage workload (1 minute, 5 minutes, 15 minutes, active processes / number of processes, last used PID)
/proc/meminfoInformation about memory.
/proc/cpuinfoInformation about CPU’s.
sysfs
DirectoryContent
/sys/blockBlock devices
/sys/class/ledsControl LED’s
/sys/class/gpioGPIO’s
/sys/devices/system/cpu/<cpuN>/cpuidle/<stateN>CPU frequency states
/sys/device/<device>/power/wakeupWakeup events
/sys/devices/system/CPU’s, clocks, …
/sys/devices/virtual/This contains devices that are memory-based
/sys/devices/platform/Devices that are not connected over a bus
/sys/power/stateRead/set power state


  • Category

  • Programming

  • Tags

  • Computer Science
    OS
    Linux
    Unix

  • Created

  • 30. September 2016


  • Modified

  • 30. September 2025