Taming Process Sprawl: Focused `ps` Output with `awk`
Quick Tip
Taming Process Sprawl: Focused `ps` Output with `awk`
Challenge: When you have a multitude of processes running on your system, the output of the standard ps aux command can be overwhelming. It’s difficult to quickly find the information you need about specific processes.
The Solution: Use awk to filter and format the output of the ps command, allowing you to focus on the columns and processes that matter most to you.
ps aux | awk '{print $1, $2, $3, $4, $11}' | grep 'your_process_name'
Why it works: This command pipes the full process list to awk, which then prints only specific columns (user, PID, CPU%, MEM%, and command). The grep command then filters these results for processes matching ‘your_process_name’.
Pro-Tip: You can customize the columns printed by awk by changing the numbers after the $ sign. For example, $1, $2, $11 selects the first, second, and eleventh columns.
Linux Tips & Tricks | © ngelinux.com | 6/11/2026
