Taming `ps`: Focused Process Info with `awk`
Quick Tip
Taming `ps`: Focused Process Info with `awk`
Challenge: The default `ps` command output can be verbose, making it difficult to quickly find specific process information like PID, CPU usage, and command name.
The Solution: Combine `ps` with `awk` to select and format only the columns you need.
ps aux | awk '{print $2, $3, $11}'
Why it works: `ps aux` provides a comprehensive snapshot of all running processes. `awk` then processes this output line by line, printing only the second (PID), third (CPU%), and eleventh (command name) fields, effectively filtering and presenting the most relevant data.
Pro-Tip: For a more interactive experience, you can pipe `ps aux` to `grep` and then `awk` to filter by a specific process name, e.g., ps aux | grep "nginx" | awk '{print $2, $3, $11}'
Linux Tips & Tricks | © ngelinux.com | 6/3/2026
