Quick Tip
Taming `ps` Output: Focused Process Info with `awk`
Challenge: The default output of the `ps` command can be overwhelming, especially on busy systems. You often need to filter and format this information to find specific process details quickly.
The Solution: Combine `ps` with `awk` to precisely select and display the columns you need.
ps aux | awk '{print $1, $2, $4, $11}'
Why it works: `ps aux` provides a comprehensive list of running processes. `awk` then parses this output line by line, and `'{print $1, $2, $4, $11}’` specifically extracts and prints the User (column 1), PID (column 2), %CPU (column 4), and Command (column 11) for each process. This significantly reduces noise and highlights key process metrics.
Pro-Tip: Use `ps -eo pid,ppid,cmd,%cpu,%mem` for a more structured output that you can then pipe to `grep` or `awk` for even more refined filtering.
Linux Tips & Tricks | © ngelinux.com | 5/23/2026
