What are /proc and /sys virtual filesystems in Linux?
Answer
/proc is a virtual filesystem that exposes kernel and process information as files. /proc/PID/ contains information about a specific process (exe, cmdline, fd, status, maps). /proc/cpuinfo shows CPU details, /proc/meminfo shows memory statistics, /proc/net/tcp shows TCP connections. These are not real files — they are generated on-demand by the kernel. /sys (sysfs) exposes the kernel's device tree and allows runtime configuration of drivers and hardware. Modify kernel parameters via /proc/sys/ using echo 1 > /proc/sys/net/ipv4/ip_forward (enables IP forwarding) or the higher-level sysctl -w net.ipv4.ip_forward=1. Both filesystems are essential for monitoring, debugging, and tuning a Linux system.
Previous
What are the basics of iptables for packet filtering?
Next
What is the difference between a symbolic link and a hard link?