Tame Your `ps` Output with Custom `awk` Formatting
Quick Tip
Tame Your `ps` Output with Custom `awk` Formatting
Challenge: The default output of the ps command can be verbose and difficult to parse when you need specific process information quickly.
The Solution: Combine ps with awk to extract and format only the data you need.
ps aux | awk '{print $2, $11}'
Why it works: This command pipes the output of ps aux (which shows all processes with detailed information) to awk. awk then prints only the second column (PID) and the eleventh column (command name) of each line, effectively cleaning up the output.
Pro-Tip: To see the CPU usage and command name, use ps aux | awk '{print $3, $11}'. You can adjust the column numbers to extract any specific field from the ps output.
Linux Tips & Tricks | © ngelinux.com | 6/27/2026
