Taming Process Output: Focused `ps` with `awk`
Quick Tip
Taming Process Output: Focused `ps` with `awk`
Challenge: The standard `ps` command can produce a lot of information, making it difficult to quickly find specific details about running processes.
The Solution: Combine `ps` with `awk` to filter and format the output to show only the columns you need.
ps aux | awk '{print $1, $2, $11}'
Why it works: `ps aux` provides a comprehensive list of processes, and `awk` then selectively prints the first ($1 – USER), second ($2 – PID), and eleventh ($11 – COMMAND) columns, giving you a cleaner, more focused view.
Pro-Tip: To sort processes by CPU usage, use `ps aux –sort=-%cpu | awk ‘{print $1, $2, $11, $3}’`.
Linux Tips & Tricks | © ngelinux.com | 5/14/2026
