/proc

From LQWiki
Jump to navigation Jump to search

/proc is typically a folder that contains information about the running processes. For example /proc/1 will contain information about the process with the id 1, that is always init. The information can be accessed like files, but technically, reading a "file" from this directory triggers a procedure within the kernel.

Historically, /proc has developed to carry other information from the kernel, for example /proc/cpuinfo. That is deprecated, this functionality is going to /sys. You should generally try to use programs accessing this information for you, like hwinfo, lsscsi, lsusb, lspci and so on (see hardware).

Examples

Read out the command line how the kernel was started (boot parameters)

tstaerk@ls3523:~> cat /proc/cmdline
root=/dev/hda2 vga=0x31a selinux=0    resume=/dev/hda1  splash=silent

Read out CPU information (better do hwinfo --cpu)

tstaerk@ls3523:~> cat /proc/cpuinfo