Linux /proc Explained: The Fake Filesystem That Tells You Everything About Your System
Open a Linux terminal, type
ls /proc, and you'll see something strange: numbered folders, files with names like cpuinfo and meminfo, and a version file — but if you check your disk, /proc takes up zero bytes. That's because /proc isn't a real folder. It's a fake filesystem the kernel builds on the fly, a live window into what's happening inside your system right now. Learn to read it, and you can diagnose almost anything without installing a single tool.
What /proc Actually Is
Every file in /proc is generated by the kernel the moment you read it. The numbers you see are process IDs — each running process gets its own folder. The named files are live system information: CPU details, memory usage, kernel version, network state. Nothing is stored; everything is current. That's why cat /proc/cpuinfo always shows your real CPU, and why the same file looks different on every machine.
The Files You'll Actually Use
/proc/cpuinfo — your processor's model, cores, speed and features. Useful when you're checking whether a machine supports virtualization (look for vmx or svm in the flags).
/proc/meminfo — total, free and available memory, plus buffers and cache. When a server feels slow, MemAvailable tells you the truth — free memory alone lies, because Linux uses spare RAM as disk cache.
/proc/version — kernel version and build info. First thing to check when a vulnerability report says "affects kernel X".
/proc/uptime — how long the system has been running, in seconds. A server that rebooted unexpectedly will show a suspiciously small number here.
/proc/loadavg — the famous load average: three numbers for the last 1, 5 and 15 minutes. On a 4-core machine, a load of 4.0 means fully busy; 8.0 means overloaded.
/proc/net/ — network state: open connections, routing tables, ARP entries. /proc/net/tcp lists every TCP connection the system knows about — a quick way to spot something phoning home.
Reading a Process Folder
Every process gets a folder named after its PID. Inside, the useful files are:
cat /proc/1234/cmdline # the exact command that started the process
cat /proc/1234/status # memory, state, user, parent process
ls -l /proc/1234/exe # where the program's binary actually lives
cat /proc/1234/environ # environment variables (may contain secrets — careful)
For security work, /proc/<pid>/exe is gold. If a process claims to be a system service but its binary lives in /tmp, something is very wrong. Malware often hides by naming itself after a legitimate process — the exe link gives it away.
Security Clues Hiding in /proc
- Hidden processes: compare
ps auxoutput with the numbered folders in /proc. A rootkit that hides a process frompsoften forgets to hide it from /proc. - Suspicious command lines:
cat /proc/*/cmdlineshows every running command. Look for base64 blobs, curl pipes to shell, or scripts running from /tmp. - Deleted-but-running binaries: if
/proc/<pid>/exepoints to a file marked(deleted), the program deleted itself from disk while still running — a classic malware trick. - Open files:
/proc/<pid>/fd/lists every file a process has open. A web server with a shell open to an odd IP address is a red flag.
Try It Now
Run these five commands and see how much you learn in thirty seconds:
cat /proc/cpuinfo | grep "model name" | head -1
cat /proc/meminfo | grep MemAvailable
cat /proc/loadavg
cat /proc/version
ls /proc | grep -E '^[0-9]+$' | wc -l
That last one counts your running processes. /proc is not trivia — it's the kernel talking to you. Learn its language, and troubleshooting stops being guesswork.



Comments
Post a Comment