Master `ps` with `awk` for Focused Process Information

Quick Tip

Master `ps` with `awk` for Focused Process Information

Challenge: The default output of the `ps` command can be overwhelming, showing a lot of information you might not need when trying to quickly identify specific processes. It’s difficult to filter and extract just the relevant details.

The Solution: Pipe the output of `ps` to `awk` for precise filtering and formatting.

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

Why it works: `awk` allows you to process text line by line and field by field. In this example, we filter for lines where the first field (`$1`) matches your username, and then print the process ID (PID, the second field, `$2`) and the command name (the eleventh field, `$11`).

Pro-Tip: For even more focused output, try filtering on specific command names: ps aux | awk '$11 ~ /nginx/ { print $2, $11 }'

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

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments