Tame Your Processes: Focused `ps` Output with `awk`
Quick Tip
Tame Your Processes: Focused `ps` Output with `awk`
Challenge: The output of the `ps` command can be overwhelming, showing a lot of information you might not need. You often want to quickly identify specific processes based on their name or user.
The Solution: Combine `ps` with `awk` for precise process filtering and column selection.
ps aux | awk '/[n]ame_of_process/ {print $1, $2, $11}'
Why it works: `ps aux` provides a comprehensive list of processes. `awk` then filters these lines, using a regular expression to match the process name (the `[n]ame_of_process` trick prevents `awk` from matching itself). Finally, `awk` prints only the user, PID, and command name.
Pro-Tip: Use `ps -ef | grep process_name` for a similar, though often less customizable, result.
Linux Tips & Tricks | © ngelinux.com | 6/21/2026
