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, especially on busy systems. You often need to quickly find specific information about processes, like their CPU or memory usage, but sifting through every column is time-consuming.

The Solution: Use `awk` to filter and display only the `ps` columns you need.

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

Why it works: `awk` is a powerful text-processing tool. By piping the output of `ps aux` to `awk` and specifying the desired column numbers (e.g., `$1` for USER, `$2` for PID, `$4` for %CPU, `$11` for COMMAND), you can create a concise and relevant process list.

Pro-Tip: To dynamically find processes by name, you can combine `grep` with `awk`: ps aux | grep 'nginx' | awk '{print $1, $2, $4, $11}'

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

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments