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

Quick Tip

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

Challenge: The output of the ps command can be overwhelming, displaying a lot of information you might not need. Finding specific processes or key details can be tedious.

The Solution: Leverage the power of awk to filter and format the output of ps, showing only the columns you care about.

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

Why it works: This command pipes the output of ps aux (which shows all processes for all users in a user-oriented format) to awk. awk then prints only the first, second, and eleventh fields, which typically correspond to the user, PID, and command name respectively. This provides a concise overview of running processes.

Pro-Tip: To filter for a specific process, like ‘nginx’, you can add a condition within awk: ps aux | awk '/nginx/ {print $1, $2, $11}'

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

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted