Taming `ps` Output with `awk` for Focused Process Info
Quick Tip
Taming `ps` Output with `awk` for Focused Process Info
Challenge: The standard `ps` command can produce verbose output, making it difficult to quickly find specific process information like a particular user’s running processes or processes owned by root.
The Solution: Leverage the power of `awk` to filter and format the output of `ps` for precise process information.
ps aux | awk '$1 == "your_username" { print $0 }'
Why it works: This command uses `ps aux` to list all processes with detailed information. The `awk` command then filters these lines, printing only those where the first field (`$1`, which is the username) matches “your_username”.
Pro-Tip: To see processes owned by root, replace $1 == "your_username" with $1 == "root". You can also customize the output further by selecting specific columns, e.g., ps aux | awk '$1 == "your_username" { print $2, $11 }' to show only the PID and command name.
Linux Tips & Tricks | © ngelinux.com | 6/4/2026
