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 overwhelmingly verbose when you need to quickly find specific information about running processes, such as a particular process’s CPU usage or memory footprint.
The Solution: Combine `ps` with `awk` to filter and format the output for precise data extraction.
ps aux | awk '$11 ~ /your_process_name/ { print $0 }'
Why it works: This command pipes the full `ps aux` output to `awk`. `awk` then processes each line, and the condition `’$11 ~ /your_process_name/’` filters for lines where the eleventh field (typically the command name) matches your specified process name. If a match is found, the entire line (`$0`) is printed.
Pro-Tip: To see only the CPU and memory usage columns for a specific process, you can refine the `awk` command: ps aux | awk '/your_process_name/ { print $3, $4 }'
Linux Tips & Tricks | © ngelinux.com | 5/28/2026
