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

Quick Tip

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

Challenge: The default output of the ps command can be overwhelming, listing many processes and their details when you only need specific information.

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

ps aux | awk '/[p]rocess_name/ {print $1, $2, $11}'

Why it works: This command pipes the output of ps aux (which shows all processes for all users) to awk. awk then filters lines containing a specific process name (using a regex trick to avoid matching awk itself) and prints only the username, PID, and command name, making it easy to pinpoint specific processes.

Pro-Tip: You can customize the fields printed by awk based on the column numbers from ps aux (e.g., $3 for %CPU, $4 for %MEM) to see exactly the metrics you care about.

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

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted