What is procfs in Linux Kernel?
Oct 19, 2025 at 19:00 pm
Question: How does the Linux Kernel handle information of multiple simultaneously running processes and their threads?
Linux Kernel uses procfs (/proc filesystem), a virtual filesystem that provides access to the state of each active process and threads in the system.
- It’s called a virtual filesystem because it lives inside of the RAM and consumes no physical storage.
- If the system is shut down or restarted, the RAM is cleared and files of the
/procdirectory are generated from scratch. - procfs provides a safe, unified, and simple text-based interface for accessing kernel info — almost everything is exposed as if it were just a file.
Note that, all the commands in this post were executed in a Docker container based off node:25-alpine image.
Let's take a look at the various files and directories inside /proc:

System-wide information (/proc)
The files within /proc provide the kernel and system-related information.
/proc/cpuinfo- CPU model, cores, cache./proc/meminfo- total/free memory, swap, etc./proc/uptime- system uptime/proc/loadavg— system load averages/proc/version— kernel version, build date and compiler used to build the kernel
For more files, please read the kernel docs.
Per-Process Information (/proc/PID)
The information related to each running process is stored within the /proc/PID directories:

The most important files are:
/proc/PID/cmdline- command line arguments passed to the process./proc/PID/cwd- link to the current working directory./proc/PID/environ- values of environment variables used by the process./proc/PID/exe- link to executable of the process./proc/PID/mem- memory held by this process./proc/PID/stat- process status (btw I don't know how to interpret the result ofcat /proc/pid/statyet!)/proc/PID/statm- process memory status information./proc/PID/status- process status in human readable form./proc/PID/task- Threads created and used by the process.
Here's an example of the status information of a process:

We can see that the name of the process is sh, it's currently in sleeping state and the process id is 1.
Now this makes total sense, as I started the container using the following command and sh is the first process that the container executes and hence it's the init process of the system (resulting in PID 1).
docker run -it node:25-alpine shSo using the /proc file system, Linux Kernel can easily manage multiple processes and their related information within the RAM. That's good. The best part is that you can always take a look at the source code to confuse yourself more!
References
- https://docs.kernel.org/filesystems/proc.html
- https://medium.com/@tepes_alexandru/the-proc-directory-in-linux-63f278e962f1
- https://fernandovillalba.substack.com/p/a-journey-into-the-linux-proc-filesystem
- https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/4/html/reference_guide/ch-proc#s2-proc-viewing
- https://www.ibm.com/docs/en/aix/7.1.0?topic=files-proc-file