≡ Menu

Explore Linux /proc File System (/proc directories, /proc files)

Inside the /proc directory, you’ll see two types of content — numbered directories, and system information files.

/proc is not a real file system, it is a virtual file system. For example, if you do ls -l /proc/stat, you’ll notice that it has a size of 0 bytes, but if you do “cat /proc/stat”, you’ll see some content inside the file.

Several Linux commands access the information from /proc, and displays in a certain format.

1. /proc Directories with names as numbers

Do a ls -l /proc, and you’ll see lot of directories with just numbers. These numbers represents the process ids, the files inside this numbered directory corresponds to the process with that particular PID.

Following are the important files located under each numbered directory (for each process):

  • cmdline – command line of the command.
  • environ – environment variables.
  • fd – Contains the file descriptors which is linked to the appropriate files.
  • limits – Contains the information about the specific limits to the process.
  • mounts – mount related information

Following are the important links under each numbered directory (for each process):

  • cwd – Link to current working directory of the process.
  • exe – Link to executable of the process.
  • root – Link to the root directory of the process.

2. /proc Files about the system information

Following are some files which are available under /proc, that contains system information such as cpuinfo, meminfo, loadavg.

  • /proc/cpuinfo – information about CPU,
  • /proc/meminfo – information about memory,
  • /proc/loadvg – load average,
  • /proc/partitions – partition related information,
  • /proc/version – linux version

Some Linux commands read the information from this /proc files and displays it. For example, free command, reads the memory information from /proc/meminfo file, formats it, and displays it.

To learn more about the individual /proc files, do “man 5 FILENAME”.

  • /proc/cmdline – Kernel command line
  • /proc/cpuinfo – Information about the processors.
  • /proc/devices – List of device drivers configured into the currently running kernel.
  • /proc/dma – Shows which DMA channels are being used at the moment.
  • /proc/fb – Frame Buffer devices.
  • /proc/filesystems – File systems supported by the kernel.
  • /proc/interrupts – Number of interrupts per IRQ on architecture.
  • /proc/iomem – This file shows the current map of the system’s memory for its various devices
  • /proc/ioports – provides a list of currently registered port regions used for input or output communication with a device
  • /proc/loadavg – Contains load average of the system
    The first three columns measure CPU utilization of the last 1, 5, and 10 minute periods.
    The fourth column shows the number of currently running processes and the total number of processes.
    The last column displays the last process ID used.
  • /proc/locks – Displays the files currently locked by the kernel
    Sample line:
    1: POSIX ADVISORY WRITE 14375 08:03:114727 0 EOF
  • /proc/meminfo – Current utilization of primary memory on the system
  • /proc/misc – This file lists miscellaneous drivers registered on the miscellaneous major device, which is number 10
  • /proc/modules – Displays a list of all modules that have been loaded by the system
  • /proc/mounts – This file provides a quick list of all mounts in use by the system
  • /proc/partitions – Very detailed information on the various partitions currently available to the system
  • /proc/pci – Full listing of every PCI device on your system
  • /proc/stat – Keeps track of a variety of different statistics about the system since it was last restarted
  • /proc/swap – Measures swap space and its utilization
  • /proc/uptime – Contains information about uptime of the system
  • /proc/version – Version of the Linux kernel, gcc, name of the Linux flavor installed.
Add your comment

If you enjoyed this article, you might also like..

  1. 50 Linux Sysadmin Tutorials
  2. 50 Most Frequently Used Linux Commands (With Examples)
  3. Top 25 Best Linux Performance Monitoring and Debugging Tools
  4. Mommy, I found it! – 15 Practical Linux Find Command Examples
  5. Linux 101 Hacks 2nd Edition eBook Linux 101 Hacks Book

Bash 101 Hacks Book Sed and Awk 101 Hacks Book Nagios Core 3 Book Vim 101 Hacks Book

Comments on this entry are closed.

  • Roman November 15, 2010, 4:30 am

    Hi guys,

    thanks for you articles. They are simple, but have normally very handy commands and useful info.

    In my system I do not have “man 5 FILENAME”. Where can I get it?

    Thank you,
    R.

  • counterdutch November 15, 2010, 6:52 pm

    read for man 5 FILENAME the proc(s)
    so man5 /proc/cmdline is an example.

    regards CD

  • Ulrich December 7, 2010, 4:01 am

    How can I find out whether my processor is 64bit capable?
    ~> grep flags /proc/cpuinfo
    flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm lahf_lm tpr_shadow vnmi flexpriority

    There you find a flag called ‘lm’ which means ‘long mode’.
    The definitions of the flags can be found in the kernel source tree, in the include/asm/cpufeature.h header. For lm:
    #define X86_FEATURE_LM (1*32+29) /* Long Mode (x86-64) */

  • kirti ranjan nayak June 26, 2011, 5:53 am

    is it /proc/stat or /proc/stats ?? plz rectify

  • bnsk October 5, 2012, 10:56 am

    /proc/stat…has all the info about a process like pid ,ppid,pgid,etc…do a man on it…

  • Mohasthim April 17, 2013, 5:32 am

    Hi,

    I can see many files under /proc directory which are writable by others (non-group) members. Though I did not try it thinking it may damage the system but same time my though is that it should not be so easy.

    However, need your expert view on files with writable permission under /proc directory.

    Kind Regards
    Mohtashim

  • Ramapriya July 8, 2013, 12:23 am

    Nice article.. but couldn’t find /proc/pci (I’m using kernel version 3.8.3)

  • anonymous June 19, 2016, 11:17 pm

    where i can find no of process sleeping running blocked and zombie in proc folder?????
    please reply

  • anonymous June 19, 2016, 11:19 pm

    where to find how many number of process are sleeping in proc folder