Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Show System Statistics from /proc Filesystem Using procinfo
The procinfo command is a powerful Linux utility that reads system statistics from the /proc filesystem and displays them in a user-friendly format. It provides quick access to essential system metrics like CPU usage, memory consumption, and process information, making it an invaluable tool for system administrators and users monitoring system performance.
The /proc filesystem is a virtual filesystem that provides real-time information about running processes and system resources. The procinfo command parses this data and presents it in an organized, readable format.
Installation
Install procinfo using your distribution's package manager
Ubuntu/Debian
sudo apt-get install procinfo
CentOS/RHEL
sudo yum install procinfo-ng
Fedora
sudo dnf install procinfo-ng
Arch Linux
sudo pacman -S procinfo-ng
Gentoo
sudo emerge procinfo-ng
Basic Usage
Run procinfo without options to display a comprehensive system overview
procinfo
This produces output similar to
Linux mycomputer 4.15.0-96-generic #97-Ubuntu SMP Wed Apr 1 03:25:46 UTC 2020 x86_64
Memory: Total Used Free Shared Buffers Cached
Mem: 327948 247776 80172 21236 66772 96880
Swap: 0 0 0
Bootup: Fri Jun 12 16:16:03 2020 Load average: 0.18 0.15 0.10 2/146 3413
User: 1 user Uptime: 0 days 01h 18m 55s
Processes: 146 running, 395 total, 1 zombie
CPU Usage: 0.0% user, 0.0% nice, 0.0% system, 100.0% idle, 0.0% IO-wait
Memory Usage Display
Use the -m option to focus specifically on memory statistics
procinfo -m
The memory section displays
| Field | Description |
|---|---|
| Total | Total physical memory available |
| Used | Memory currently in use by processes |
| Free | Unused physical memory |
| Shared | Memory used by shared memory objects |
| Buffers | Memory used for buffer caches |
| Cached | Memory used for page cache and slab cache |
Memory: Total Used Free Shared Buffers Cached
Mem: 7948 7191 757 416 3077 2399
Swap: 8191 1287 6904
CPU Usage Display
Display CPU utilization statistics with the -c option
procinfo -c
CPU Usage: user nice sys idle irq
2.4% 0.0% 1.0% 95.1% 1.4%
The CPU metrics show
User Time spent executing user-space processes
Nice Time spent on low-priority user processes
System Time spent executing kernel code
Idle Time when CPU was not active
IRQ Time spent handling hardware interrupts
Process Information
View detailed information about a specific process using the -p option followed by the process ID
procinfo -p 1234
Process Information: PID PPID CPU% MEM% VSZ RSS TTY STAT START TIME COMMAND 1234 1 2.4 0.2 12856 8464 ? S 17:50 0:05 firefox
This output includes process ID, parent process ID, CPU and memory usage percentages, virtual memory size (VSZ), resident set size (RSS), terminal, process state, start time, and the command name.
Key Features
Real-time data Reads current statistics from
/procfilesystemMultiple views Supports focused displays for memory, CPU, or process information
System overview Provides comprehensive system status in a single command
Lightweight Minimal resource consumption while monitoring
Conclusion
The procinfo command is an essential tool for Linux system monitoring that leverages the /proc filesystem to provide comprehensive system statistics. It offers administrators and users a quick, efficient way to monitor memory usage, CPU utilization, and process information in a readable format, making system performance analysis straightforward and accessible.
