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 overwhelming, especially on busy systems. You often need to quickly find specific processes based on criteria like CPU usage, memory, or command name, but sifting through columns of data is inefficient.

The Solution: Use `awk` to filter and format the output of `ps` for targeted process information.

ps aux | awk '{if ($3 > 10.0) print $0}'

Why it works: This command pipes the comprehensive `ps aux` output to `awk`. `awk` then processes each line, and the `if ($3 > 10.0)` condition checks if the third column (which typically represents CPU utilization percentage) is greater than 10.0. If true, the entire line (`$0`) is printed, showing you only high-CPU processes.

Pro-Tip: Combine with `sort -nk 3 -r` to sort processes by CPU usage in descending order: ps aux | awk '{if ($3 > 1.0) print $0}' | sort -nk 3 -r

Linux Tips & Tricks | © ngelinux.com | 6/14/2026

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted