Linux Display System Statistics Gathered From /proc

How do I display information from /proc such as memory, Load average, uptime, page activity, context, disk status, interrupts using a shell or perl script?

You can write a shell or perl script to grab all info from /proc file system. But Linux comes with the procinfo command to gather some system data from the /proc directory and prints it nicely formatted on the screen.

Install procinfo Command

Open a command-line terminal (select Applications > Accessories > Terminal), and then type the following commands under Debian or Ubuntu Linux:
$ sudo apt-get update
$ sudo apt-get install procinfo

The command apt-get update is used tell apt to refresh its package information by querying the configured repositories and then install the procinfo package. If you are using CentOS / RHEL / Fedora / Redhat Linux, enter:
# yum install procinfo

How Do I Use procinfo Command?

Simply type the following command, enter:
# procinfo
Sample outputs:

Fig.01: procinfo - display system statistics gathered from /proc

The information displayed is:
  • Memory: Display amount of free and used memory in the system
  • Bootup: The time the system was booted.
  • Load average: The average number of jobs running, followed by the number of runnable processes and the total number of processes, followed by the PID of the last process run. The pid of the last running process will probably always be procinfo’s PID.
  • user: The amount of time spent running jobs in user space.
  • nice: The amount of time spent running niced jobs in user space.
  • system: The amount of time spent running in kernel space. Note: the time spent servicing interrupts is not counted by the kernel (and nothing that procinfo can do about it).
  • idle: The amount of time spent doing nothing.
  • uptime: The time that the system has been up. The above four should more or less add up to this one.
  • page in: The number of disk blocks paged into core from disk. 1 block is equal to 1 kiB.
  • page out: The number of disk blocks paged out of core to disk. This includes regular disk-writes.
  • swap in: The number of memory pages paged in from swap.
  • swap out: The number of memory pages paged out to swap.
  • context: The number of context switches, either since bootup or per interval.
  • Disk stats(sda, hda, sdb etc): The number of reads and writes made to disks, whether CD-ROM, hard-drive, or USB. Shows all disks if they either are an hdX or sdX, or if they have a non-zero read/write count.
  • Interrupts: Number of interrupts serviced since boot, or per interval, listed per IRQ.

Task: Run procinfo Continuously Full-screen

The -f option can run procinfo continuously on screen and the default is 5 seconds between update. The -n option can be used to set pause update time. In this example procinfo will pause 20 seconds between update:
# procinfo -f -n 20
You can change its behaviour by pressing d, D, S, r, b, and q which toggle the flags quits the program. The flags also correspond to their same-named commandline-options

       -d     For memory, CPU times, paging, swapping, disk, context and interrupt stats, display values per second rather than totals. This option implies -f.

       -D     Same as -d, except that memory stats are displayed as totals.

       -S     When running with -d or -D, always show values per second, even when running with -n N with N greater than one second.

       -b     Display numbers of bytes rather than number of I/O requests.

       -r     This option adds an extra line to the memory info showing 'real' free memory, just as free(1) does. The numbers produced assume that Buffers and Cache are disposable.

(Fig. 02: Source man page).


See procinfo man page for more information.

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 8 comments so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersdf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
8 comments… add one
  • sempft Mar 18, 2011 @ 14:02

    on ubuntu it’s “procinfo”, not “proceinfo”
    probably the same on debian

  • halohell Mar 18, 2011 @ 14:07

    well there is a typo,
    sudo apt-get install procinfo
    yum install procinfo

  • 🐧 nixCraft Mar 18, 2011 @ 14:33

    Thanks for the heads up!

  • Roman Mar 19, 2011 @ 6:44

    Procinfo-NG is even better!
    Procinfo-NG, a replacement for procinfo. Has most of the same features, but is written in clean C++ and has fixed many of the features that were broken due to changes in the 2.4 and 2.6 kernels.

    Plus, it uses uint64 for almost everything, and thus should be 64-bit safe.

  • abdulkerim Mar 21, 2011 @ 16:57

    how to be learn beginner oracle . thanks

  • Jack Wade May 16, 2011 @ 5:11

    Don’t forget linfo – a php script that when ran under linux gets its info from /proc


  • me Feb 15, 2012 @ 8:03

    I sure wish someone would show how to determine/decipher this data from the /proc filesystem, without having to install some program to do it for us…

  • Sanjay K May 6, 2013 @ 5:26

    In CentOS -6.3 , this is not available

    yum install procinfo

    No package procinfo available.
    Error: Nothing to do


Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum