Master `ps` Output with `awk` for Focused Process Info
Quick Tip
Master `ps` Output with `awk` for Focused Process Info
TITLE: Master `ps` Output with `awk` for Focused Process Info
Challenge: The `ps` command provides a wealth of process information, but it can be overwhelming and difficult to extract specific details quickly. You often need to see just a few key pieces of information for active processes.
The Solution: Combine `ps` with `awk` to precisely select and display the columns you care about.
ps aux | awk '{print $1, $2, $4, $11}'
Why it works: `ps aux` lists all running processes with user, CPU, memory, and command details. `awk` then processes this output line by line, and `{print $1, $2, $4, $11}` instructs it to print only the first (User), second (PID), fourth (CPU%), and eleventh (Command) fields, effectively filtering and organizing the output.
Pro-Tip: To see the command with arguments, adjust the `$11` to the appropriate column number based on your `ps` output, or use `ps aux | awk ‘$0=$0’ OFS=’\t’`.
Linux Tips & Tricks | © ngelinux.com | 6/13/2026
