Tame Your `ps` Output: Focused Process Info with `awk`
Quick Tip
Tame Your `ps` Output: Focused Process Info with `awk`
Challenge: The output of the `ps` command can be overwhelming, showing far more information than you need to identify specific processes or their resource usage.
The Solution: Combine `ps` with `awk` to filter and display only the columns you care about, making process monitoring significantly more efficient.
ps aux | awk '{print $2, $11, $12}'
Why it works: `ps aux` lists all running processes with detailed information. `awk ‘{print $2, $11, $12}’` then processes this output, printing only the second (PID), eleventh (command name), and twelfth (arguments, if any) fields for each line, giving you a concise overview of running processes.
Pro-Tip: To see CPU and memory usage, try: ps aux | awk '{print $2, $3, $4, $11}' (PID, %CPU, %MEM, COMMAND).
Linux Tips & Tricks | © ngelinux.com | 6/24/2026
