Quick Tip
Master `ps` Output with Custom `awk` Formatting
Challenge: The default output of the ps command can be verbose and difficult to parse for specific process information, especially when monitoring many processes.
The Solution: Leverage awk to filter and format the ps command output for precise process monitoring.
ps aux | awk '{print "PID: "$2", User: "$1", CPU: "$3"%, MEM: "$4"%, Command: "$11}'
Why it works: This command pipes the full output of ps aux to awk, which then prints only the Process ID (column 2), User (column 1), CPU usage (column 3), Memory usage (column 4), and the command name (column 11), making it highly readable for quick analysis.
Pro-Tip: Combine this with grep to filter for specific processes, e.g., ps aux | grep nginx | awk '{print "PID: "$2", User: "$1", CPU: "$3"%, MEM: "$4"%, Command: "$11}'.
Linux Tips & Tricks | © ngelinux.com | 6/10/2026
