Taming `ps` Output: Focused Process Info with `awk`

Quick Tip

Taming `ps` Output: Focused Process Info with `awk`

Challenge: The `ps` command can often produce a lot of output, making it difficult to quickly find specific information about processes like their CPU or memory usage.

The Solution: Combine `ps` with `awk` to filter and format the output for exactly what you need.

ps aux | awk '$11 ~ /your_process_name/ { print $2, $4, $6, $11 }'

Why it works: `ps aux` provides a comprehensive view of running processes. `awk` then processes each line, filtering for lines where the 11th field (command name) contains “your_process_name” and printing specific fields (PID, %CPU, %MEM, command).

Pro-Tip: For a real-time, continuously updating view, pipe the `ps aux` output to `watch -n 1 ‘awk …’`

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

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments