The /proc
filesystem is where Linux stores the data related to the currently running processes. In most cases, a casual user would probably never (hopefully never) need to know this information. However, it can be really helpful during debugging, or if you just want to know about some of the internals of Linux.
The following steps explain how to see the information contained in /proc
:
Let’s try an experiment in
/proc
as root run:file uptime
It shows
uptime: empty
, right? So if we cat it, there should be no output ideally, right? Try it:cat uptime
Wow, so how did that happen? The files in
/proc
are special because the information is read out of them in real time. Let’s try some more and run the following command:cat interrupts
Now run
cat version
andcat meminfo
.In another session, run the following command:
vi test5.txt
Let’s find its PID:
ps auxw | grep “vi test5.txt”
Change to that directory in
/proc
:cd /proc/<pid-from...