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

Quick Tip

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

Challenge: The output of the `ps` command can be overwhelmingly verbose, making it difficult to quickly find the specific process information you need.

The Solution: Pipe the output of `ps` to `awk` to filter and format the information precisely.

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

Why it works: This command uses `awk` to select and print specific columns (Process ID, Command Name, and arguments) from the `ps aux` output, giving you a cleaner, more focused view of running processes.

Pro-Tip: Use `ps -ef | awk ‘{if ($3 ~ /^[0-9]+$/) print $2, $8}’` to see PID and Command Name only for processes owned by a user (where the UID is a number).

Linux Tips & Tricks | © ngelinux.com | 7/3/2026

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted