/proc (and maybe /sys) is a very interesting "filesystem" in that it doesn't actually exist. Rather, it is an elegant invention created completely by the Linux kernel for the express purpose of supplying parameters and other information to you ... and, if you are root, for modifying those parameters, as well.
For example, let's arbitrarily take /proc/sys/kernel/vm/max-readahead. If you use the cat command to read this "file," you'll see that it contains a number, like "128." This literally is the value of this arcane kernel parameter.
If you were root, you would find that you could write a different number to it. If you did that, you would have the effect of immediately changing this arcane kernel parameter! (By the way, I am not suggesting that you go now and actually do this!)
If there was ever a place where most operating-systems get totally bogged down, it would be in passing magical numbers and information to-and-from the kernel. "The /proc filesystem" is easily the most elegant solution to this vexing problem that I have ever seen anywhere. It lets otherwise-magic programs, like ps, not have to be magic or powerful at all: it works by looking for numbered "files" in /proc. (Each numbered-file corresponds to a process-ID...)
You can learn quite a lot about Linux just by trolling through this filesystem, not as root, and wondering what this-or-that "file" is for, and what it is telling you...
|