Quick Tip
Taming Process Output: Focused `ps` with `awk`
Challenge: The standard `ps aux` command outputs a lot of information, making it difficult to quickly find specific process details like CPU or memory usage.
The Solution: Use `awk` to filter and display only the columns you need from the `ps` output.
ps aux | awk '{print $1, $2, $3, $4, $11}'
Why it works: `awk` is a powerful text-processing tool that can split lines into fields. By specifying the fields you want (e.g., User, PID, %CPU, %MEM, Command), you can create a more concise and readable output from `ps`.
Pro-Tip: To sort the output by CPU usage, pipe it through `sort -k3nr` (e.g., ps aux | awk '{print $1, $2, $3, $4, $11}' | sort -k3nr).
Linux Tips & Tricks | © ngelinux.com | 5/22/2026
