Tame Your Processes: Focused `ps` Output with `awk`
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 find specific process information like CPU usage, memory, or the full command line.
The Solution: Combine ps with awk to filter and format the output.
ps aux | awk '{print $1 "\t" $2 "\t" $3 "\t" $4 "\t" $11}'
Why it works: ps aux lists all running processes with detailed information. awk then processes this output line by line, printing only the specified fields (User, PID, %CPU, %MEM, Command) separated by tabs for easier readability.
Pro-Tip: You can easily customize the fields by changing the numbers in the awk command. For example, to see just the PID and the full command: ps aux | awk '{print $2 "\t" $11}'
Linux Tips & Tricks | © ngelinux.com | 6/16/2026
