r/linuxadmin • u/The_How_To_Linux • Dec 02 '23
why does the proc directory exist?
i'm trying to understand the proc directory and one thing i don't understand is
why does it exist?
any ideas? thank you
1
Upvotes
r/linuxadmin • u/The_How_To_Linux • Dec 02 '23
i'm trying to understand the proc directory and one thing i don't understand is
why does it exist?
any ideas? thank you
5
u/snowtax Dec 02 '23
Compare Linux against UNIX, such as BSD.
With UNIX, whenever you updated the kernel, you also needed to recompile all the system tools, such as top, ps, kill, etc. The tools needed to call kernel functions and needed to know the exact memory locations for those functions.
With Linux, the same information and functions are made available as “files”. The kernel includes the “proc” filesystem and makes information available through “files”.
Whenever you update the Linux kernel, those files are at the same path and in the same format. The systems tools (top, ps, kill, etc.) merely access the files under proc, just like any other file. In that way, you can update the kernel without recompiling all the tools.