Taming `ps` Output: Focused Process Info with `awk`
Quick Tip
Taming `ps` Output: Focused Process Info with `awk`
Challenge: The output of the ps command can be overwhelming, displaying a multitude of processes with various details. Often, you only need to see specific information, like the process name and its CPU/memory usage, making it difficult to parse quickly.
The Solution: Leverage the power of awk to filter and format the output of ps for precisely what you need.
ps aux | awk '{print $11, $3, $4}'
Why it works: The ps aux command lists all processes. We then pipe this output to awk, which processes each line. In this example, we instruct awk to print the 11th field (the command name), the 3rd field (CPU usage), and the 4th field (memory usage) from each line.
Pro-Tip: You can customize the fields by changing the numbers in the awk command. For example, ps aux | awk '{print $2, $12}' would show the PID and the full command with arguments.
Linux Tips & Tricks | © ngelinux.com | 6/16/2026
