Quick Tip
Tame Your Processes: Focused `ps` Output with `awk`
Challenge: The output of the `ps` command can often be overwhelming, showing far more information than you need when trying to identify a specific process or its resource usage. This makes it difficult to quickly pinpoint what you’re looking for.
The Solution: Use `awk` to filter and format the output of `ps` for clarity.
ps aux | awk '/your_process_name/ { print $1, $2, $3, $4, $11 }'
Why it works: This command pipes the full output of `ps aux` to `awk`. `awk` then filters for lines containing “your_process_name” and prints only the User, PID, CPU%, MEM%, and the Command fields, significantly reducing clutter.
Pro-Tip: You can easily customize the fields printed by `awk` by changing the numbers within the curly braces. For example, `$1, $2, $3, $4, $11` prints the first five fields relevant to process information.
Linux Tips & Tricks | © ngelinux.com | 6/11/2026
