Taming `ps` Output with `awk` for Focused Process Info
Quick Tip
Taming `ps` Output with `awk` for Focused Process Info
Challenge: The output of the ps command can be overwhelmingly verbose, making it difficult to quickly find specific process information like PID, user, or CPU usage.
The Solution: Combine ps with awk to precisely select and format the columns you need.
ps aux | awk '{print $2, $1, $11}'
Why it works: This command pipes the output of ps aux (which shows all running processes with user and CPU details) into awk. awk then processes each line, printing only the second column (PID), first column (User), and eleventh column (Command Name), effectively filtering and organizing the data.
Pro-Tip: For even more specific filtering, you can add conditions to awk. For example, to find processes owned by ‘root’ using more than 5% CPU: ps aux | awk '$1 == "root" && $3 > 5.0 {print $2, $1, $3, $11}'
Linux Tips & Tricks | © ngelinux.com | 7/5/2026
