Quick Tip
Taming Process Sprawl: Focused `ps` Output with `awk`
Challenge: When you have many processes running, the output of the `ps` command can be overwhelming. It’s difficult to quickly find specific information you’re looking for, like CPU or memory usage for a particular application.
The Solution: Use `awk` to filter and format the output of `ps` to display only the columns you need, tailored to your specific search.
ps aux | awk '{print $1, $2, $3, $4, $11}' | grep "your_process_name"
Why it works: This command first lists all processes (`ps aux`). Then, `awk` is used to select specific columns (user, PID, %CPU, %MEM, and command name). Finally, `grep` filters this streamlined output for the process you’re interested in.
Pro-Tip: To see only running processes owned by the current user, use `ps -u $(whoami) | awk ‘{print $1, $2, $3, $4, $11}’`.
Linux Tips & Tricks | © ngelinux.com | 6/29/2026
