Quick Tip
Tame Your Processes: Focused `ps` Output with `awk`
Challenge: The standard `ps` command can be overwhelming with its verbose output, making it difficult to find specific process information like CPU usage, memory, or parent process ID.
The Solution: Use `ps` in conjunction with `awk` to precisely select and format the columns you need.
ps aux | awk '{print $1, $2, $4, $11}'
Why it works: This command pipes the output of `ps aux` (which shows all running processes with user and CPU/memory details) to `awk`. `awk` then processes each line, printing only the fields corresponding to the User (1), PID (2), %CPU (4), and Command (11), effectively filtering out unnecessary information.
Pro-Tip: For an even more precise view, use `ps -eo user,pid,%cpu,%mem,cmd` which allows you to specify columns directly, then pipe that to `awk` for further formatting if needed.
Linux Tips & Tricks | © ngelinux.com | 5/21/2026
