Master `ps` Output with `awk` for Focused Process Info
Quick Tip
Master `ps` Output with `awk` for Focused Process Info
Challenge: The output of the ps aux command can be overwhelming, showing every detail of every running process. Often, you only need specific information like CPU/memory usage or process names.
The Solution: Pipe the output of ps aux to awk to filter and display only the columns you’re interested in.
ps aux | awk '{print $1, $2, $3, $4, $11}'
Why it works: awk is a powerful text-processing tool that can parse lines into fields. By specifying field numbers (e.g., $1 for USER, $3 for %CPU, $4 for %MEM, $11 for COMMAND), you can precisely control what information is displayed.
Pro-Tip: Use ps aux | awk '{if ($3 > 5.0) print $0}' to display only processes consuming more than 5% CPU.
Linux Tips & Tricks | © ngelinux.com | 6/21/2026
