Streamline Process Monitoring with `ps` and `awk`

Quick Tip

Streamline Process Monitoring with `ps` and `awk`

Challenge: When you need to quickly identify specific processes or their resource usage from the output of the `ps` command, sifting through columns can be tedious.

The Solution: Use `awk` to filter and format the `ps` output for targeted information.

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

Why it works: This command pipes the output of `ps aux` (which shows all processes for all users with detailed information) to `awk`. `awk` then filters for lines containing “nginx” and prints specific columns (PID, %CPU, and COMMAND) for a concise view.

Pro-Tip: You can customize the columns you print and the search term to monitor any process you need. For example, to see memory usage for Java processes: ps aux | awk '/java/{print $1, $4, $11}'

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

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted