Taming `ps` Output with `awk` for Focused Process Info

Quick Tip

Taming `ps` Output with `awk` for Focused Process Info

Challenge: The output of the ps command can be overwhelming, showing too much information when you only need specific details about processes.

The Solution: Combine ps with awk to filter and format the output, showing only the columns you need.

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

Why it works: ps aux provides a comprehensive list of running processes. awk '{print $1, $2, $4, $11}' then selects and prints only the first (USER), second (PID), fourth (STAT), and eleventh (COMMAND) fields from each line of the ps output.

Pro-Tip: You can easily change the column numbers ($1, $2, etc.) in the awk command to display different fields from the ps output. For example, to see PID, %CPU, and %MEM: ps aux | awk '{print $2, $3, $4}'.

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

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments