Quick Tip
Taming `ps` Output: Focused Process Info with `awk`
Challenge: The output of the `ps` command can be overwhelming, displaying a lot of information about running processes that you might not need. You want a way to quickly filter and display only the specific process details you’re interested in.
The Solution: Combine `ps` with `awk` to extract and display only the desired columns.
ps aux | awk '{ print $1, $2, $11 }'
Why it works: `ps aux` provides a comprehensive list of processes. `awk` then processes this output line by line, and the `{ print $1, $2, $11 }’` part tells it to print the first, second, and eleventh fields (typically USER, PID, and COMMAND, respectively) for each line, effectively filtering the output.
Pro-Tip: You can customize the `$1, $2, $11` to include any column number you need. Use `ps aux | head -1` to see the header row and identify column numbers for other useful information like CPU usage (`%CPU`) or memory usage (`%MEM`).
Linux Tips & Tricks | © ngelinux.com | 5/31/2026
