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 when you need to quickly find specific information about running processes, such as their CPU usage or command name.

The Solution: Combine `ps` with `awk` to filter and format the output, focusing only on the columns you need.

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

Why it works: This command first lists all running processes in detail (`ps aux`). Then, `awk` is used to select and print specific fields (user, PID, CPU%, MEM%, and command) from each line of the output, providing a cleaner and more targeted view.

Pro-Tip: To sort the output by CPU usage (descending), pipe the `awk` output to `sort -rnk 3`.

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

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted