Taming `ps` Output: Focused Process Info with `awk`
Quick Tip
Taming `ps` Output: Focused Process Info with `awk`
Challenge: The default output of the `ps` command can be overwhelming, showing too much information when you only need specific details about running processes.
The Solution: Pipe the output of `ps aux` (or `ps -ef`) to `awk` to filter and format the process information precisely to your needs.
ps aux | awk '{print $1, $2, $11}'
Why it works: `awk` allows you to specify fields (columns) from the input. In this case, `$1` is the USER, `$2` is the PID, and `$11` is the COMMAND, giving you a cleaner, more focused view.
Pro-Tip: Use `awk ‘{print $2, $11}’` to see just the PID and Command, or add conditions like `awk ‘$1 ~ /root/ {print $2, $11}’` to filter processes by user.
Linux Tips & Tricks | © ngelinux.com | 6/17/2026
