Quick Tip
Master `ps` Output: Focused Process Info with `awk`
Challenge: The output of the `ps` command can be overwhelming, especially when you’re trying to quickly identify specific processes or extract particular information like PIDs, command names, or CPU/memory usage.
The Solution: Combine `ps` with `awk` for precise filtering and formatting of process information.
ps aux | awk '$3 > 10.0 { print $2, $11, $3 }'
Why it works: This command lists all running processes (`ps aux`), then uses `awk` to filter lines where the third column (CPU usage, `$3`) is greater than 10.0. It then prints the PID (second column, `$2`), command name (eleventh column, `$11`), and CPU usage (third column, `$3`). You can easily adapt the column numbers and conditions to suit your needs.
Pro-Tip: For even more targeted process information, use `ps -eo pid,comm,pcpu,%mem` to specify exactly which columns you want to display, and then pipe that to `awk` for filtering.
Linux Tips & Tricks | © ngelinux.com | 5/28/2026
