Master Process Monitoring: Focused `ps` Output with `awk`

Quick Tip

Master Process Monitoring: Focused `ps` Output with `awk`

Challenge: The standard `ps aux` or `ps -ef` commands often produce a verbose output, making it difficult to quickly pinpoint specific process information like CPU usage, memory consumption, or the command path for a particular process.

The Solution: Leverage the power of `awk` to filter and format `ps` output for precise process monitoring.

ps aux | awk '{print $1, $2, $4, $11}'

Why it works: This command pipes the output of `ps aux` to `awk`. `awk` then processes each line, printing only the first column (USER), second column (PID), fourth column (CPU%), and eleventh column (COMMAND). You can easily customize the columns to display the exact information you need.

Pro-Tip: To see processes sorted by CPU usage in descending order, use: ps aux --sort=-%cpu | head -n 10

Linux Tips & Tricks | © ngelinux.com | 5/30/2026

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted