O'Reilly logo

Fedora® Linux® TOOLBOX: 1000+ Commands for Fedora, CentOS, and Red Hat® Power Users by Christopher Negus, François Caen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix C. Getting Information from /proc

IN THIS APPENDIX

  • Viewing /proc information

  • Changing /proc information variables

Originally intended to be a location for storing information used by running processes, the /proc file system eventually became the primary location for storing all kinds of information used by the Linux kernel. Despite the emergence of /sys to provide a more orderly framework for kernel information, many Linux utilities still gather and present data about your running system from /proc.

If you are someone who prefers to cut out the middleman, you can bypass utilities that read /proc files and read (and sometimes even write to) /proc files directly. By checking /proc, you can find out the state of processes, hardware devices, kernel subsystems, and other attributes of Linux.

Viewing /proc information

Checking out information in files from the /proc directory can be done by using a simple cat command. In /proc, there is a separate directory for each running process (named by its process ID) that contains information about the process. There are also /proc files that contain data for all kinds of other things, such as your computer's CPU, memory usage, software versions, disk partitions, and so on.

The following examples describe some of the information you can get from your Linux system's /proc directory:

$ cat /proc/cmdline         Shows options passed to the boot prompt
ro root=LABEL=/123 rhgb quiet
$ cat /proc/cpuinfo         Shows information about your processor Processor : 0 vendor_id ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required