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

Quick Tip

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

Challenge: The output of the ps aux command can be overwhelmingly verbose when you’re trying to find specific process information like the command name, PID, and CPU/memory usage.

The Solution: Leverage awk to elegantly filter and format the ps output to show only the columns you need.

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

Why it works: This command pipes the output of ps aux to awk, which then prints specific fields (columns). In this case, it prints the user (column 1), PID (column 2), CPU usage (column 3), memory usage (column 4), and the command itself (column 11).

Pro-Tip: You can easily customize the output by changing the column numbers in the awk command to include or exclude different fields from the ps output.

Linux Tips & Tricks | © ngelinux.com | 5/23/2026

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments