Quick Tip
Master `ps` Output with Custom `awk` Formatting
TITLE: 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, making it hard to quickly identify key metrics like CPU usage, memory, or command name.
The Solution: Leverage `awk` to filter and format `ps` output for precisely the information you need.
ps aux | awk '{print $1, $2, $3, $4, $11}'
Why it works: `ps aux` provides a detailed snapshot of all running processes. `awk` then processes this output line by line, printing only the specified columns (USER, PID, %CPU, %MEM, COMMAND), allowing for a cleaner, more focused view of process data.
Pro-Tip: For an even more tailored output, you can add conditions to your `awk` command, for example, to only show processes using more than 5% CPU: ps aux | awk '$3 > 5 {print $1, $2, $3, $4, $11}'
Linux Tips & Tricks | © ngelinux.com | 5/15/2026
