Master `ps` Output: Focused Process Info with `awk`
Quick Tip
Master `ps` Output: Focused Process Info with `awk`
Challenge: The `ps` command often provides a deluge of information about running processes, making it difficult to quickly find specific details like process IDs (PIDs) and command names. We need a way to filter and format this output for better readability and quicker analysis.
The Solution: Leverage `awk` to parse and display only the essential columns from `ps` output.
ps aux | awk '{print $1, $2, $11}'
Why it works: `ps aux` provides a comprehensive snapshot of all running processes. `awk` then processes this output line by line, and the `{print $1, $2, $11}` part tells `awk` to print the first (user), second (PID), and eleventh (command name) fields of each line, effectively filtering and organizing the data.
Pro-Tip: To quickly find a specific process, pipe the output to `grep`, like: ps aux | awk '{print $1, $2, $11}' | grep "nginx"
Linux Tips & Tricks | © ngelinux.com | 6/12/2026
