Master `ps` Output with `awk` for Focused Process Information
Quick Tip
Master `ps` Output with `awk` for Focused Process Information
Challenge: The default output of the `ps` command can be overwhelming, showing far too much information when you’re trying to quickly identify specific processes or resource usage.
The Solution: Combine `ps` with `awk` to precisely filter and display only the columns you need.
ps aux | awk '{print $1, $2, $11}'
Why it works: `awk` is a powerful text-processing tool that can parse lines of text based on delimiters (spaces by default) and print specific fields. Here, we’re selecting the USER (field 1), PID (field 2), and COMMAND (field 11) from the `ps aux` output.
Pro-Tip: Use `ps -eo user,pid,ppid,cmd,%mem,%cpu –sort=-%mem | head -n 10` to quickly see the top 10 memory-consuming processes sorted by memory usage.
Linux Tips & Tricks | © ngelinux.com | 6/27/2026
