Tame `ps` Output: Focused Process Info with `awk`
Quick Tip
Tame `ps` Output: Focused Process Info with `awk`
Challenge: The `ps` command can be incredibly verbose, making it difficult to quickly find specific process information like CPU usage, memory, or command arguments.
The Solution: Combine `ps` with `awk` to filter and format the output to your exact needs.
ps aux | awk '{print $2, $4, $11}'
Why it works: `awk` processes the output of `ps` line by line, allowing you to specify which columns (fields) to print. In this example, we’re printing the Process ID (column 2), %CPU (column 4), and the command name (column 11).
Pro-Tip: Use `ps auxww` to get even more command-line detail, and `awk` can then display it all. For example, to see the full command line for all processes: ps auxww | awk '{print $2, $12}'
Linux Tips & Tricks | © ngelinux.com | 6/15/2026
