Taming `ps` Output: Focused Process Info with `awk`
Quick Tip
Taming `ps` Output: Focused Process Info with `awk`
Challenge: The output of the `ps` command can be overwhelmingly verbose, making it difficult to quickly find specific process information like CPU usage, memory, or command name.
The Solution: Leverage `awk` to filter and format the `ps` command output for precise information.
ps aux | awk '{print $1, $2, $4, $11}'
Why it works: `ps aux` provides a comprehensive snapshot of running processes. `awk ‘{print $1, $2, $4, $11}’` then selects and prints specific columns: USER (column 1), PID (column 2), %CPU (column 4), and COMMAND (column 11). You can adjust the column numbers to extract different pieces of information.
Pro-Tip: For even more specific filtering, use `awk`’s conditional statements. For example, to see only processes using more than 5% CPU: ps aux | awk '$4 > 5 {print $1, $2, $4, $11}'
Linux Tips & Tricks | © ngelinux.com | 6/20/2026
