Streamline Process Monitoring with `ps` and `awk`

Quick Tip

Streamline Process Monitoring with `ps` and `awk`

Challenge: The default output of the `ps` command can be overwhelming, containing a lot of information that isn’t always relevant for quick monitoring of specific processes. Extracting just the essential details can be cumbersome.

The Solution: Combine `ps` with `awk` to filter and format process information precisely to your needs.

ps aux | awk '$1 == "your_user" && $11 ~ /your_process_name/ { print $2, $11, $12 }'

Why it works: This command uses `ps aux` to get a detailed listing of all running processes. `awk` then filters this output: `$1 == “your_user”` selects processes owned by a specific user, `$11 ~ /your_process_name/` checks if the command name (often the 11th field or later depending on the command) contains a specific string, and finally, `print $2, $11, $12` displays the PID, command name, and its arguments. You can customize the fields printed and the filtering criteria.

Pro-Tip: For a quick count of processes belonging to a user, use `ps -u your_user | wc -l`.

Linux Tips & Tricks | © ngelinux.com | 5/18/2026

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments