Taming `ps` Output: Focused Process Info with `awk`
Quick Tip
Taming `ps` Output: Focused Process Info with `awk`
Challenge: The standard `ps` command often outputs a lot of information, making it difficult to quickly find specific details about running processes, like their CPU usage or memory consumption.
The Solution: Combine `ps` with `awk` to filter and display only the columns you need.
ps aux | awk '{print $1, $2, $4, $11}'
Why it works: `ps aux` lists all processes for all users with detailed information. `awk` then processes this output line by line, printing only the specified fields: User (1), PID (2), %CPU (4), and Command (11). This allows for a quick, custom view of essential process metrics.
Pro-Tip: For even more specific filtering, you can add conditions to `awk`. 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/12/2026
