Site icon New Generation Enterprise Linux

Tame Your `ps` Output: Focused Process Info with `awk`

Quick Tip

Tame Your `ps` Output: Focused Process Info with `awk`

Challenge: The `ps` command can produce a lot of output, making it difficult to quickly find specific information about running processes. You often end up `grep`-ing the output, which can be cumbersome.

The Solution: Leverage the power of `awk` to filter and format the `ps` command output directly, giving you precisely the information you need.

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

Why it works: This command uses `awk` to select specific columns (user, PID, %CPU, and command name) from the `ps aux` output, providing a concise and targeted view of your processes.

Pro-Tip: To display only processes owned by a specific user, you can add a condition to `awk`: `ps aux | awk ‘$1 == “your_username” {print $2, $11}’`

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

0 0 votes
Article Rating
Exit mobile version