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 overwhelmingly verbose, making it difficult to quickly find specific process information like PID, command name, and CPU/memory usage.

The Solution: Pipe the output of ps to awk to select and format only the columns you need.

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

Why it works: This command uses awk to select specific fields (columns) from the ps aux output. By default, awk uses whitespace as a delimiter, and we print the User, PID, Command, %CPU, and %MEM columns for a concise overview.

Pro-Tip: For an even more precise view, you can use ps -eo user,pid,comm,%cpu,%mem which directly asks ps to output specific fields, eliminating the need for awk in many cases.

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

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted