Quick Tip
Taming `ps` Output: Focused Process Info with `awk`
Challenge: The default output of the ps command can be overwhelming, showing a lot of information you might not need. This makes it hard to quickly find specific process details.
The Solution: Pipe the output of ps to awk to select and format only the columns you care about.
ps aux | awk '{print $1, $2, $11}'
Why it works: awk processes the output line by line, and using positional parameters like $1 (first column), $2 (second column), and $11 (eleventh column) allows you to extract and display only the user, PID, and command name, respectively.
Pro-Tip: Use ps -eo user,pid,comm for a more direct and often more readable way to select specific columns without needing awk for simple cases.
Linux Tips & Tricks | © ngelinux.com | 5/18/2026
