How to Use the procs Command to Show Active Processes in Linux
You’ll learn how to install procs, a lightweight yet powerful alternative to ps and top, and how to use it to get a clear, hierarchical view of your running processes.
Why Pick procs Over the Classic Tools?
When I started troubleshooting a memory leak on a server, the default top output was a blur of numbers. Switching to procs gave me a tidy tree that let me spot the offending child process in seconds. Unlike ps, it shows real‑time CPU and memory usage, and unlike htop, you don’t need to toggle columns or dig through menus.
Installing procs
- Debian/Ubuntu
sudo apt-get install procs
- Fedora/RHEL
sudo dnf install procs
- Arch Linux
sudo pacman -S procs
If you’re on a distro that doesn’t ship it, just grab the source from < https://github.com/dalance/procs> and build it. The Makefile is a single line: make install.
Basic Usage
Simply type:
procs
You’ll see something like this:
PID PPID CPU% MEM% USER COMMAND 1234 1 0.2 1.3 root /usr/lib/systemd/systemd 5678 1234 12.5 30.7 user ./myapp -v
The hierarchy is obvious: child processes are indented under their parents, and the CPU/MEM columns show real‑time usage.
Why this matters: The indentation removes the guesswork of figuring out which process belongs to which parent, a pain in ps -ef where you have to match numbers manually.
Filtering with Grep
If you’re hunting for a particular service:
procs | grep nginx
You’ll get only the lines that contain “nginx”, keeping the output focused. This is handy when your system has hundreds of processes and you need to zero in on one.
Sorting by CPU or Memory
Add --sort followed by a key:
procs --sort=cpu
or
procs --sort=mem
The most resource‑hungry processes will float to the top, making it easy to spot bottlenecks. I’ve seen this happen after a bad driver update that caused an endless loop of high CPU usage; sorting by cpu instantly revealed the culprit.
Using procs in Scripts
Because procs outputs plain text, you can pipe its data into other tools:
procs --json | jq '.[] | select(.mem > 50)'
This line dumps the process list as JSON and then uses jq to filter any that use more than 50 % of RAM. It’s a quick way to alert yourself or trigger an automated cleanup script.
Customizing Columns
Want to see thread count instead of memory? Use:
procs --cols pid,ppid,user,cpu,threads,command
The order of columns is entirely up to you. I usually keep pid, user, and cpu visible, because those are the numbers that matter most when diagnosing a slow machine.
When procs Isn’t Enough
If you need real‑time graphs or interactive sorting, stick with htop. But for a quick snapshot on a headless server where you can’t afford a full TUI, procs is the sweet spot between detail and speed.
That’s all there is to it. Grab procs, give your process list a tidy makeover, and watch the chaos shrink into an easy‑to‑read tree.