What it is
procs is a modern, enhanced replacement for ps that offers better output formatting, interactive filtering, and more detailed process information.
Installation
Linux:
sudo apt update && sudo apt install procs
# or
sudo dnf install procs
# or
sudo pacman -S procs
macOS:
brew install procs
Windows:
(Windows support is experimental and may have limitations. It’s generally recommended to use procs on Linux/macOS or via WSL.)
winget install procs
# or
scoop install procs
Core Concepts
procs displays processes with a focus on rich information and interactivity. Key differences from ps include:
- Colorized Output: By default, output is colorized for readability.
- Interactive Filtering: You can type directly into the
procsoutput to filter processes in real-time. - Expanded Information: Includes more details like I/O stats, CPU usage over time, and network connections by default.
- Tree View: Easily visualize process parent-child relationships.
Commands / Usage
Basic Process Listing
-
List all processes:
procsDisplays a table of running processes with detailed columns.
-
List processes for a specific user:
procs --user rootShows only processes owned by the
rootuser. -
List processes by a specific command name:
procs --name firefoxFilters to show processes whose command name contains "firefox".
-
List processes with specific PIDs:
procs --pid 1234 --pid 5678Shows only processes with PIDs 1234 and 5678.
-
List processes by parent PID (PPID):
procs --ppid 1Shows processes whose parent process ID is 1 (typically
initorsystemd).
Interactive Filtering and Control
-
Enter interactive mode:
procsOnce
procsis running, you can type directly into the terminal to filter the list.- Type
firefoxto see only processes related to Firefox. - Type
^rootto find processes owned byroot. - Press
Ctrl+Cto exit interactive mode.
- Type
-
Toggle color output:
procs --color offDisables color highlighting in the output.
-
Force color output:
procs --color onEnables color highlighting even if
procsdoesn’t detect a TTY.
Process Details and Sorting
-
Show process tree view:
procs --treeDisplays processes in a hierarchical tree structure.
-
Sort by CPU usage (descending):
procs --sort cpu:descLists processes with the highest CPU usage at the top.
-
Sort by memory usage (ascending):
procs --sort mem:ascLists processes with the lowest memory usage at the top.
-
Sort by process name:
procs --sort name:ascSorts the process list alphabetically by command name.
-
Show only specific columns:
procs --display pid,cpu,mem,commOnly shows the PID, CPU usage, Memory usage, and Command Name columns.
-
Show all available columns:
procs --display allLists all possible columns
procscan display. -
Add more columns to default display:
procs --extra pid,ppid,user,cpu,mem,io,net,cmdShows default columns plus PID, PPID, User, CPU, Memory, I/O, Network, and full Command.
Killing Processes
-
Send SIGTERM to a process:
procs --kill 1234Attempts to gracefully terminate process with PID 1234.
-
Send SIGKILL to a process:
procs --kill 1234 --signal KILLForcefully terminates process with PID 1234.
-
Kill multiple processes:
procs --pid 1234 --pid 5678 --kill 1234 --kill 5678Kills processes 1234 and 5678.
-
Kill all processes matching a name (use with caution!):
procs --name "unwanted_process" --kill --signal KILLForcefully kills all processes whose command name contains "unwanted_process".
Filtering Options
-
Filter by CPU usage greater than a percentage:
procs --cpu-min 10Shows processes using more than 10% CPU.
-
Filter by memory usage greater than a percentage:
procs --mem-min 5Shows processes using more than 5% of memory.
-
Filter by I/O read rate:
procs --io-read-min 1MShows processes with a read rate of at least 1 Megabyte per second.
-
Filter by I/O write rate:
procs --io-write-max 0Shows processes with no write activity.
-
Filter by network traffic (received):
procs --net-recv-min 10kShows processes receiving at least 10 Kilobytes per second.
-
Filter by network traffic (sent):
procs --net-send-max 1kShows processes sending less than 1 Kilobyte per second.
-
Exclude processes by PID:
procs --exclude-pid 1234Shows all processes except the one with PID 1234.
-
Exclude processes by name:
procs --exclude-name systemdShows all processes except those named "systemd".
Other Options
-
Update interval:
procs --interval 2Updates the process list every 2 seconds (default is 1 second).
-
Show process status:
procs --status runningShow only processes in the 'running' state. Valid states include:
running,sleeping,disk-sleep,stopped,zombie,trace-stop,dead,wake-kill,waking,parser. -
Show command line arguments:
procs --cmdlineDisplays the full command line with arguments for each process.
Common Patterns
-
Find and kill a runaway process:
procs --sort cpu:desc | head -n 10 # View top 10 CPU consumers procs --name "apache2" --sort mem:desc # Find memory-hungry apache processes procs --name "bad_script.sh" --kill --signal KILL # Kill all instances of a bad script -
Monitor network activity of specific services:
procs --name "nginx" --extra net procs --user www-data --extra net --sort net:desc # See what www-data processes are sending/receiving -
Identify processes with high I/O wait:
procs --sort io:desc --extra io # Find processes doing heavy disk I/O -
View processes in a tree, filtered by user:
procs --user myuser --tree -
Batch kill processes by name (use with extreme caution):
# First, list them to be sure: procs --name "old_service" # Then, if confident, kill them: procs --name "old_service" --kill --signal KILL -
Combine interactive filtering with sorting: Run
procs, typepythonto filter, then pressShift+Mto sort by memory.
Gotchas
- Permissions for killing: You can only kill processes that you own, or if you are running
procsas root. --killwith--nameor--user: When using--killwith broad filters like--nameor--user,procswill attempt to kill all matching processes. Double-check your filters before executing.- Signal names: The
--signaloption accepts standard signal names (e.g.,KILL,TERM,HUP).procswill often default toTERMif not specified. - Interactive mode limitations: While interactive filtering is powerful, complex regex might be slow or behave unexpectedly. For advanced filtering, using command-line arguments is more robust.
- Resource Usage:
procsitself consumes some system resources. For extremely low-resource environments or when monitoring a very large number of processes, its overhead might be noticeable compared tops. - Windows Experimental: Network and I/O statistics might be less reliable or unavailable on Windows due to OS differences.