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

Quick Tip

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

Challenge: The default output of the ps command can be overwhelming, displaying a lot of information that might not be immediately relevant when you need to quickly identify specific processes or their resource usage.

The Solution: Use awk to filter and format the ps output for targeted information.

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

Why it works: This command pipes the comprehensive output of ps aux (which shows all processes for all users) to awk. awk then prints only the specified columns: the username (column 1), the PID (column 2), and the command name (column 11), giving you a cleaner, more focused view.

Pro-Tip: To see processes sorted by CPU usage, you can use ps aux --sort=-%cpu | awk '{print $1, $2, $11}'.

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

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments