Tame Your `ps` Output: Focused Process Info with `awk`
Quick Tip
Tame Your `ps` Output: Focused Process Info with `awk`
Challenge: The standard `ps aux` or `ps -ef` output can be overwhelmingly verbose, making it difficult to quickly find specific process details like CPU usage, memory consumption, or the full command line for a particular service.
The Solution: Use `awk` to filter and format the `ps` output for precisely what you need.
ps aux | awk '$11 ~ /nginx/ {print $1, $2, $4, $11}'
Why it works: This command pipes the output of `ps aux` to `awk`. `awk` then processes each line, and the condition `’$11 ~ /nginx/’` filters for lines where the eleventh field (which typically contains the command name) contains “nginx”. The `print $1, $2, $4, $11` then outputs specific fields: User, PID, %CPU, and Command.
Pro-Tip: To see only processes using more than 10% CPU, use `ps aux | awk ‘$3 > 10 {print $1, $2, $3, $11}’`
Linux Tips & Tricks | © ngelinux.com | 5/17/2026
