Glossary

/proc

Also known as: procfs

/proc is a virtual filesystem ("procfs") that the Linux kernel exposes at /proc. It contains no real files on disk—its contents are generated on the fly by the kernel in response to read requests—but it behaves enough like a filesystem that ordinary tools like cat, grep, and shell redirection can interrogate and sometimes modify kernel state. It was inherited from Plan 9's philosophy that "everything is a file."

Each running process has a directory under /proc/<pid>/ containing files like cmdline (the command line), status (memory and state), maps (memory mappings), fd/ (open file descriptors), environ (environment variables), and cwd (a symlink to the working directory). System-wide information lives in files like /proc/cpuinfo, /proc/meminfo, /proc/mounts, /proc/loadavg, /proc/version, and /proc/net/tcp.

Writing to files under /proc/sys/ can tune kernel parameters at runtime:

cat /proc/sys/net/ipv4/ip_forward
echo 1 > /proc/sys/net/ipv4/ip_forward
sysctl -w net.ipv4.ip_forward=1   # preferred interface

Over time, much of /proc's non-process content has been moved to /sys and /sys/kernel/debug, but the process-related parts remain the canonical interface that tools like ps, top, htop, and lsof read under the hood.

Related terms: /sys, Kernel, Process

Discussed in:

Also defined in: Textbook of Linux