Taming `ps` Output: Focused Process Info with `awk`
Quick Tip
Taming `ps` Output: Focused Process Info with `awk`
Challenge: The standard `ps` command often produces a lot of information, making it difficult to quickly find specific details about running processes, such as their CPU or memory usage.
The Solution: Pipe the output of `ps` to `awk` to selectively display and format the columns you need.
ps aux | awk '{print $1, $2, $4, $11}'
Why it works: `awk` is a powerful text-processing tool that can parse input line by line and field by field. By specifying the desired column numbers ($1 for USER, $2 for PID, $4 for %CPU, $11 for COMMAND), we can create a concise and tailored output.
Pro-Tip: Use `ps auxf | awk ‘{print $1, $2, $4, $11}’` to also see the process tree structure alongside the selected columns.
Linux Tips & Tricks | © ngelinux.com | 6/4/2026
