Taming `ps` with `awk` for Focused Process Information
Quick Tip
Taming `ps` with `awk` for Focused Process Information
Challenge: The output of the `ps` command can often be overwhelmingly verbose, making it difficult to quickly find specific process information like PID, CPU usage, or memory consumption.
The Solution: Combine `ps` with `awk` to precisely select and format the columns you need.
ps aux | awk '{print $1, $2, $3, $4, $11}'
Why it works: The `ps aux` command provides a detailed snapshot of all running processes. `awk` then processes this output line by line, printing only the specified fields (user, PID, %CPU, %MEM, and command name in this example) separated by spaces.
Pro-Tip: To see only processes owned by a specific user, use: ps -u yourusername -o pid,%cpu,%mem,cmd.
Linux Tips & Tricks | © ngelinux.com | 5/22/2026
