Streamline Process Monitoring with `ps` and `awk`
Quick Tip
Streamline Process Monitoring with `ps` and `awk`
Challenge: You need to quickly filter and view specific information from the output of the `ps` command, such as only showing processes owned by a particular user or with a certain name, without sifting through a lot of irrelevant data.
The Solution: Pipe the output of `ps` to `awk` for targeted filtering and formatting.
ps aux | awk '$1 == "your_username" { print $1, $2, $11 }'
Why it works: `ps aux` provides a comprehensive list of running processes. `awk` then processes this output line by line, and the condition `’$1 == “your_username”‘` filters for lines where the first field (username) matches your input. The `print $1, $2, $11` then displays only the username, PID, and command name.
Pro-Tip: Use `ps -ef | grep “process_name”` for a simpler but less flexible way to find processes by name.
Linux Tips & Tricks | © ngelinux.com | 5/13/2026
