Pcornel
Linux · Filesystem

/proc

Cheat sheet · https://pcornel.dk/topic.php?topic=2666

Back to the Topic

Answer

/proc is a virtual filesystem (procfs) generated by the kernel: one directory per process (/proc/<pid>) plus system information (/proc/cpuinfo, /proc/meminfo, /proc/sys).

Remember

Nothing in /proc uses disk space. /proc/sys values can be changed with sysctl (persist in /etc/sysctl.d/). /proc/<pid>/ shows a process's command line, environment, open files and limits.

First checks

  • ls -ld <path> — owner, permissions and type
  • stat <path> — inode, links, size and timestamps
  • df -h <path> — filesystem and free space
  • findmnt <path> — which mount the path is on

Verify in this order

/proc mounted (or virtual) → correct owner and permissions → enough space → services read and write as intended

Where it usually breaks

First mismatch in hardware/block device → kernel driver/mapper/RAID/LVM → filesystem → mount namespace/options → path permissions/MAC → consumer I/O; preserve identity/native diagnostic/pre-state before mutation.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=2666

Confirmation

Confirm action

Continue?