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

Quick Tip

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

Challenge: The output of the `ps` command can be overwhelming, making it difficult to quickly find specific process information like the process ID (PID), command name, and CPU/memory usage.

The Solution: Combine `ps` with `awk` to filter and display only the columns you need, giving you a concise and readable process list.

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

Why it works: `ps aux` provides a comprehensive list of running processes, and `awk` allows us to specify which fields (columns) to print from that output. In this example, we’re selecting user, PID, %CPU, %MEM, and the command name.

Pro-Tip: Use `ps -eo pid,ppid,cmd,%cpu,%mem` for a more structured, predefined output that you can then pipe to `awk` if further manipulation is needed.

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

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments