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

Quick Tip

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

Challenge: The default output of the ps command can be overwhelming, showing far more information than you might need. Extracting specific details about running processes can be a tedious manual task.

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

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

Why it works: This command pipes the output of ps aux (which shows all processes with user, CPU/memory usage, and command) to awk. awk then prints only the first ($1 – USER), second ($2 – PID), and eleventh ($11 – COMMAND) columns, giving you a clean, focused view of the process owner, ID, and name.

Pro-Tip: To find specific processes, you can add a condition to awk, like ps aux | awk '/nginx/ {print $1, $2, $11}' to only show lines containing “nginx”.

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

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments