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 more information than you often need. It’s hard to quickly find specific process details like CPU usage, memory, or the full command line.

The Solution: Leverage the power of `awk` to filter and format `ps` output for precise information retrieval.

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

Why it works: This command pipes the output of `ps aux` (which provides a comprehensive snapshot of running processes) to `awk`. `awk` then prints only specific columns: user (1), PID (2), CPU% (3), MEM% (4), and the command (11), giving you a cleaner, more focused view of your running processes.

Pro-Tip: To filter for a specific process, pipe the output to `grep` *before* `awk`, or use `awk`’s pattern matching capabilities: ps aux | awk '/nginx/{print $1, $2, $3, $4, $11}'

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

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments