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 line arguments.
The Solution: Leverage the power of awk to filter and format the output of ps, presenting only the essential data you need.
ps aux | awk '{print $1, $2, $4, $11}'
Why it works: This command pipes the full output of ps aux to awk. awk then prints specific columns (User, PID, %CPU, and Command) by default, allowing you to easily scan for the information you’re interested in.
Pro-Tip: You can customize the columns by changing the numbers within the awk command, e.g., ps aux | awk '{print $1, $2, $5, $11}' to show RSS memory instead of %CPU.
Linux Tips & Tricks | © ngelinux.com | 6/18/2026
