Tame Your Processes: Focused `ps` Output with `awk`
Quick Tip
Tame Your Processes: Focused `ps` Output with `awk`
Challenge: The output of the ps command can be overwhelming, listing every process with a multitude of details. Often, you just need to quickly filter for specific information, like processes owned by a particular user or those using a certain amount of CPU.
The Solution: Combine ps with awk to precisely filter and display the information you need.
ps aux | awk '$1 == "your_username" { print $0 }'
Why it works: The ps aux command lists all running processes with detailed information. awk then processes this output line by line, and the condition '$1 == "your_username"' filters for lines where the first field (the username) matches your specified username, printing the entire matching line ({ print $0 }).
Pro-Tip: Use awk‘s pattern matching for more complex filtering, like finding processes consuming more than 5% CPU: ps aux | awk '$3 > 5.0 { print $0 }'
Linux Tips & Tricks | © ngelinux.com | 6/23/2026
