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

Quick Tip

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

Challenge: The standard ps command can produce a lot of output, making it difficult to quickly find specific process information like CPU usage, memory consumption, or the command line arguments.

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

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

Why it works: This command pipes the full output of ps aux (which shows all processes for all users) to awk. awk then prints only the fields corresponding to user, PID, CPU percentage, and command name (fields 1, 2, 4, and 11 respectively).

Pro-Tip: You can easily customize the fields by changing the numbers in the awk command. For example, to also see memory usage (field 6), use ps aux | awk '{print $1, $2, $4, $6, $11}'.

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

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments