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

Quick Tip

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

Challenge: The output of the `ps aux` command can be overwhelming, especially when you’re trying to find specific processes or understand resource usage. It’s often too verbose for quick analysis.

The Solution: Use `awk` to filter and format the `ps` output, allowing you to see only the columns you care about.

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

Why it works: `awk` is a powerful text-processing tool that can split lines into fields. By specifying which fields (columns) you want (`$1` for USER, `$2` for PID, `$4` for %CPU, `$11` for COMMAND), you can drastically reduce the noise and focus on the essential information.

Pro-Tip: To sort processes by CPU usage, pipe the output to `sort -rnk3` (where 3 is the %CPU column number).

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

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted