Quick Tip
Streamline `ps` Output: Focused Process Info with `awk`
Challenge: The output of the `ps aux` command can be overwhelming, making it difficult to quickly find specific process information like CPU usage, memory consumption, or command name.
The Solution: Leverage `awk` to filter and format the output of `ps` for targeted insights.
ps aux | awk '{print $1, $2, $3, $4, $11}'
Why it works: This command pipes the standard output of `ps aux` to `awk`. `awk` then processes each line, printing only the specified columns: USER (1), PID (2), %CPU (3), %MEM (4), and COMMAND (11). This dramatically cleans up the output, making it easier to scan.
Pro-Tip: To sort by CPU usage, you can pipe the output to `sort -rnk3` (sort numerically, reversed, on the 3rd column): ps aux | awk '{print $1, $2, $3, $4, $11}' | sort -rnk3
Linux Tips & Tricks | © ngelinux.com | 6/15/2026
