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

Quick Tip

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

Challenge: The `ps` command can be overwhelmingly verbose when you’re looking for specific process information. Filtering and reformatting its output to your exact needs can be tedious.

The Solution: Leverage `awk` to surgically extract and present the process details you care about.

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

Why it works: `awk` processes the output of `ps aux` line by line, treating each column as a distinct field. This command specifically prints the User (field 1), PID (field 2), and Command (field 11) for each process, giving you a concise overview.

Pro-Tip: To sort processes by CPU usage, pipe the output to `sort -nrk 3` (for descending numerical sort on the 3rd column, which would be CPU usage if you included it).

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

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted