Quick Tip
Taming `ps`: Focused Process Info with `awk`
Challenge: The `ps` command is incredibly powerful, but its output can be overwhelming when you’re looking for specific process information. Manually sifting through it is tedious and error-prone.
The Solution: Combine `ps` with `awk` to filter and format process output with precision.
ps aux | awk '$1 == "your_username" {print $2, $11}'
Why it works: `ps aux` provides a comprehensive list of processes. `awk` then acts as a powerful filter, checking if the first field (`$1`, the username) matches “your_username”. If it does, it prints the process ID (`$2`) and the command name (`$11`).
Pro-Tip: To see all processes owned by root, replace your_username with root. You can also adjust which fields `awk` prints by changing $2, $11 to other column numbers from the `ps aux` output (e.g., `$1, $2, $4, $11` for user, PID, %CPU, and command).
Linux Tips & Tricks | © ngelinux.com | 7/1/2026
