Taming Process Output: Focused `ps` with `awk`
Quick Tip
Taming Process Output: Focused `ps` with `awk`
TITLE: Taming Process Output: Focused `ps` with `awk`
Challenge: The `ps` command provides a wealth of information about running processes, but often it’s too verbose for quick analysis. You might want to quickly isolate specific columns or filter processes based on certain criteria.
The Solution: Combine `ps` with `awk` for precise column selection and filtering.
ps aux | awk '{print $1, $2, $11}' | grep 'my_process_name'
Why it works: `ps aux` outputs detailed process information. `awk ‘{print $1, $2, $11}’` then selects only the username (column 1), PID (column 2), and the command name (column 11). Finally, `grep ‘my_process_name’` filters this reduced output to show only lines containing your target process.
Pro-Tip: Use `ps -eo pid,user,cmd,pcpu,pmem` to specify the exact columns you want to see from `ps` itself, and pipe that to `awk` for further manipulation if needed.
Linux Tips & Tricks | © ngelinux.com | 6/2/2026
