Quick Tip
Taming `ps` Output: Focused Process Info with `awk`
Challenge: The `ps` command provides a wealth of information about running processes, but its default output can be overwhelming and difficult to parse for specific details.
The Solution: Use `awk` to filter and format `ps` output for precise process information.
ps aux | awk '{print $1, $2, $11}'
Why it works: This command pipes the full output of `ps aux` to `awk`. `awk` then processes each line, printing only the fields corresponding to the User (1st column), PID (2nd column), and Command (11th column, which might be truncated if it’s long). This provides a clean, focused view of essential process details.
Pro-Tip: To filter for a specific process by name, you can add a condition to `awk`, like: ps aux | awk '/nginx/ {print $1, $2, $11}'.
Linux Tips & Tricks | © ngelinux.com | 6/25/2026
