Quick Tip
Master `ps` Output with Custom `awk` Formatting
Challenge: The default output of the `ps` command can be verbose and difficult to parse for specific process information, especially when dealing with many running processes.
The Solution: Leverage `awk` to filter and format the output of `ps` for precisely the information you need.
ps aux | awk '{print $1, $2, $11}'
Why it works: This command uses `ps aux` to list all running processes in a user-oriented format and then pipes the output to `awk`. `awk` then processes each line, printing only the first column (USER), second column (PID), and eleventh column (COMMAND), effectively creating a cleaner, more focused output.
Pro-Tip: To sort processes by CPU usage (descending), you can use `ps aux –sort -%cpu | awk ‘{print $1, $2, $11}’`
Linux Tips & Tricks | © ngelinux.com | 5/26/2026
