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 overwhelming, especially on busy systems, making it hard to find the specific process information you need.
The Solution: Pipe the output of `ps` to `awk` to filter and format the information.
ps aux | awk '$1 == "youruser" {print $2, $11}'
Why it works: `awk` allows you to process text line by line and field by field. In this case, it filters for lines where the first field (`$1`) matches “youruser” (replace with the actual username) and then prints the process ID (second field, `$2`) and the command name (eleventh field, `$11`).
Pro-Tip: Use `ps aux | awk ‘{print $2, $11}’ | grep “your_process_name”` to quickly find the PID and name of a specific process.
Linux Tips & Tricks | © ngelinux.com | 7/1/2026
