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 PID, command name, or CPU/memory usage.
The Solution: Combine ps with awk to filter and format the output for precise information.
ps aux | awk '{print $1, $2, $11}'
Why it works: ps aux lists all processes with detailed information. awk '{print $1, $2, $11}' then selects and prints only the first (User), second (PID), and eleventh (Command) columns, providing a cleaner, more targeted view.
Pro-Tip: To see the full command with arguments, use ps aux | awk '{print $1, $2, $11 " " $12 " " $13}' (adjusting column numbers as needed or using ps -ef and a different awk structure for full command path).
Linux Tips & Tricks | © ngelinux.com | 7/1/2026
