Taming Process Sprawl: Focused `ps` Output with `awk`
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 information about running processes. You often need to sift through many columns to get to the details you care about.
The Solution: Use `awk` to filter and format the `ps` command’s output, displaying only the columns you need.
ps aux | awk '{print $1, $2, $11}'
Why it works: The `ps aux` command provides a comprehensive list of running processes. `awk` then processes this output line by line, and by specifying `$1, $2, $11`, we instruct it to print only the username (field 1), PID (field 2), and the command name (field 11) for each process, creating a much more readable summary.
Pro-Tip: You can customize the fields to display anything you need. For example, to see the process name and its CPU usage, try ps aux | awk '{print $11, $3}'.
Linux Tips & Tricks | © ngelinux.com | 6/5/2026
