Quick Tip
Taming `ps`: Focused Process Info with `awk`
Challenge: The output of the `ps` command can be incredibly verbose, making it difficult to quickly find specific process information like PID, CPU usage, or memory consumption for a particular application.
The Solution: Combine `ps` with `awk` to filter and format the output, presenting only the crucial details you need.
ps aux | awk '/[p]rocess_name/ {print $2, $3, $4, $11}'
Why it works: `ps aux` provides a comprehensive list of running processes. `awk` then filters this output, searching for lines containing ‘process_name’ (replace this with the actual process name or a unique part of it) and printing only the specified columns (PID, %CPU, %MEM, COMMAND in this example). The `[p]` in the `awk` pattern prevents `awk` from matching its own process.
Pro-Tip: Use `ps -eo pid,pcpu,pmem,comm` for a more column-specific approach if your `awk` skills are rusty, though `awk` offers more flexibility.
Linux Tips & Tricks | © ngelinux.com | 6/19/2026
