Quick Tip
Taming `ps` Output with `awk` for Focused Process Info
Challenge: The output of the ps command can be overwhelming, showing a lot of information that isn’t always relevant. It’s hard to quickly find specific process details.
The Solution: Use awk to filter and format the ps output, displaying only the columns you need.
ps aux | awk '{print $1, $2, $3, $4, $11}'
Why it works: awk is a powerful text-processing tool that can select specific fields (columns) from each line of input. Here, we’re selecting the USER (1st field), PID (2nd), %CPU (3rd), %MEM (4th), and the COMMAND (11th field) from the ps aux output.
Pro-Tip: To see only processes owned by a specific user (e.g., ‘myuser’), you can add a condition to awk: ps aux | awk '$1 == "myuser" {print $1, $2, $3, $4, $11}'
Linux Tips & Tricks | © ngelinux.com | 6/19/2026
