Tame Your Processes: Focused `ps` Output with `awk`

Quick Tip

Tame Your Processes: Focused `ps` Output with `awk`

Challenge: The output of the ps command can be overwhelmingly verbose, making it difficult to pinpoint specific process details like CPU usage, memory consumption, or command line arguments.

The Solution: Leverage the power of awk to filter and format the output of ps for precisely the information you need.

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

Why it works: This command pipes the output of ps aux (which provides detailed process information) to awk. awk then processes each line, printing only the specified fields: user (column 1), PID (column 2), %CPU (column 4), and command (column 11).

Pro-Tip: To see the full command line for a process, including arguments, use ps auxww | awk '{print $1, $2, $4, $11}'. The ‘ww’ flag prevents truncation of the command column.

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

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted