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 overwhelmingly verbose, making it difficult to find specific process information quickly. You often need to sift through numerous columns to locate what you’re looking for.

The Solution: Combine `ps` with `awk` to filter and display only the columns you need, such as PID, user, and command name.

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

Why it works: `awk` is a powerful text-processing tool that can parse each line of `ps` output, and by specifying column numbers (e.g., `$1` for User, `$2` for PID, `$11` for Command), you can tailor the output to your exact needs.

Pro-Tip: Use `ps -ef` instead of `ps aux` and adjust the column numbers in `awk` accordingly for a different `ps` output format. For example, `ps -ef | awk ‘{print $1, $3, $8}’` often shows User, PID, and Command.

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

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments