-
Notifications
You must be signed in to change notification settings - Fork 0
LinuxFoundation
Dej edited this page Apr 22, 2020
·
38 revisions
- Linux Filesystem Tree Layout
-
one large logical filesystem which can contain one or many distinct filesystems mounted at various points
-
Filesystem Hierarchy Standard : shareable (can shared between hosts)
| shareable | unshareable | |
|---|---|---|
| static | /usr /opt | /etc /boot |
| ----------- | ------------------ | -------------------- |
| variable | /var/mail | /var/run /var/lock |
- Main directories:
- /bin : contains binary executable files (cat, kill, ps) . Command binaries which are deemed non essential enough are in /usr/bin.
- /lib: contains libraries needed to execute the binaries in /bin or /sbin . Also kernel module are in /lib/modules/
- /boot: essential files for booting the system (vmlinuz compressed linux kernel and initrd initial RAM filesystem which is mounted before the real root filesystem becomes available, config to configure kernel compilation)
- /dev: device nodes aka device files (byte-stream or block I/O devices). Network devices (eth1 , eth2) do not have device nodes
- /usr: can be thought of as a secondary hierarchy, need not reside in the same partition as the root directory
- /etc: contains machine-local configuration files/scripts (/etc/systemd contains config scripts for starting, stopping system services using systemd ; also /etc/init.d which contains scripts for System V initialization)
- /var: logs in /var/log and cron jobs, mail file in /var/spool, lock files in /var/lock or
cat /var/log/yum.log - /proc: is the mount point for a pseudo-filesystem, where all information resides only in memory, not on disk. The entires in /proc are called virtual files with zero bytes in size.
# List files opened by a process
lsof -p PID
# equivalent more or less with
ls -l /proc/PID/fd