Master `ps` Output: Focused Process Info with `awk`
Quick Tip
Master `ps` Output: Focused Process Info with `awk`
Challenge: The output of the `ps` command can be overwhelming, especially when you’re looking for specific process details. It’s often hard to quickly isolate the information you need.
The Solution: Pipe the output of `ps` to `awk` to select and format specific columns.
ps aux | awk '{print $1, $2, $11}'
Why it works: `awk` processes input line by line and can split each line into fields based on whitespace. Here, we’re printing the first field (user), the second field (PID), and the eleventh field (command name) from the `ps aux` output for a cleaner, more targeted view.
Pro-Tip: Use `ps -eo user,pid,cmd` for a more explicit and less error-prone way to select columns without relying on field numbers.
Linux Tips & Tricks | © ngelinux.com | 5/11/2026
