Quick Tip
Taming Process Sprawl: Focused `ps` Output with `awk`
Challenge: The output of the `ps` command can be incredibly verbose, making it difficult to quickly find specific process information, especially on busy systems.
The Solution: Pipe the output of `ps aux` to `awk` to select and format the columns you need.
ps aux | awk '{print $1, $2, $3, $4, $11}'
Why it works: `awk` is a powerful text-processing utility that can parse lines based on fields (columns). By specifying which fields you want (`$1` for USER, `$2` for PID, `$3` for %CPU, `$4` for %MEM, and `$11` for COMMAND), you create a concise, tailored output.
Pro-Tip: To sort this filtered output by CPU usage (the 3rd column in our `awk` output), you can pipe it to `sort -nrk3`.
Linux Tips & Tricks | © ngelinux.com | 6/13/2026
