Tame Your Processes: Focused `ps` Output with `awk`
Quick Tip
Tame Your Processes: Focused `ps` Output with `awk`
Challenge: The default output of the ps command can be overwhelming, making it difficult to quickly find specific process information like PID, CPU usage, and memory consumption.
The Solution: Combine ps with awk to extract and display only the columns you need.
ps aux | awk '{print $1, $2, $3, $4, $11}'
Why it works: ps aux provides detailed process information, and awk '{print $1, $2, $3, $4, $11}' then extracts the specified fields (user, PID, %CPU, %MEM, and command name) for each process, creating a much cleaner and more focused output.
Pro-Tip: You can customize the field numbers in awk to display any desired columns from the ps output. For example, ps aux | awk '{print $2, $5}' will show PID and RSS memory usage.
Linux Tips & Tricks | © ngelinux.com | 6/17/2026
