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

Quick Tip

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

Challenge: The standard `ps aux` command provides a wealth of information about running processes, but it can be overwhelming and difficult to extract specific details quickly.

The Solution: Leverage the power of `awk` to filter and format the output of `ps` for targeted information retrieval.

ps aux | awk '/[p]rocess_name/ {print $2, $11}'

Why it works: This command pipes the output of `ps aux` to `awk`. The `awk` command then filters lines containing “process_name” (the `[p]` prevents `awk` from matching its own process) and prints the second column (PID) and the eleventh column (command name).

Pro-Tip: To see processes owned by a specific user, use `ps -u username | awk ‘/[p]rocess_name/ {print $1, $5}’` where `$1` is the user and `$5` is the command.

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

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments