Tame Your `ps` Output: Focused Process Info with `awk`
Quick Tip
Tame Your `ps` Output: Focused Process Info with `awk`
Challenge: The output of the ps command can be overwhelming, especially when you’re looking for specific process details. Manually sifting through columns is inefficient.
The Solution: Use awk to filter and format the output of ps, showing only the columns you need.
ps aux | awk '{print $1, $2, $11}'
Why it works: This command pipes the output of ps aux (which provides detailed process information) to awk. awk then prints only the first (user), second (PID), and eleventh (command) fields from each line, giving you a cleaner, more focused view.
Pro-Tip: To sort processes by CPU usage (descending), you can pipe the output to sort -nrk3: ps aux | awk '{print $1, $2, $3, $11}' | sort -nrk3
Linux Tips & Tricks | © ngelinux.com | 5/13/2026
