Tame Your Processes: Focused `ps` Output with `awk`
Quick Tip
Tame Your Processes: Focused `ps` Output with `awk`
Challenge: The output of the ps command can be overwhelming, especially on busy systems. You often need to filter it to find specific processes based on CPU usage, memory, or other criteria, which can be tedious with multiple grep or grep -E commands.
The Solution: Leverage the power of awk to efficiently filter and format the output of ps directly.
ps aux | awk '$3 > 10.0 { print $0 }'
Why it works: This command pipes the output of ps aux to awk. awk then processes each line, and the condition '$3 > 10.0' checks if the third field (CPU percentage) is greater than 10.0. If it is, the entire line ($0) is printed.
Pro-Tip: Use awk '$4 > 500.0 { print $0 }' to filter processes consuming more than 500MB of memory (field $4 is RSS in KB by default with ps aux).
Linux Tips & Tricks | © ngelinux.com | 6/28/2026
