Quick Tip
Tame Your Processes: Focused `ps` Output with `awk`
Challenge: The output of the `ps` command can be overwhelmingly verbose, making it difficult to quickly identify specific processes or key metrics. You need a way to filter and extract only the information you’re interested in efficiently.
The Solution: Combine `ps` with `awk` to precisely select and format the columns you need.
ps aux | awk '{print $1, $2, $11}'
Why it works: `ps aux` provides a comprehensive list of running processes, and `awk` allows us to specify which fields (columns) to print based on their positional index. Here, `$1` is the user, `$2` is the PID, and `$11` is the command name.
Pro-Tip: Use `ps -eo pid,ppid,cmd,%mem,%cpu –sort=-%cpu | head -n 10` to quickly see the top 10 CPU-consuming processes with specific details.
Linux Tips & Tricks | © ngelinux.com | 6/6/2026
