Quick Tip
Taming `ps` Output: Focused Process Info with `awk`
Challenge: The `ps` command provides a wealth of process information, but often it’s too much to sift through to find exactly what you need. You might want to quickly see only the process ID (PID), user, and command name.
The Solution: Combine `ps` with `awk` to precisely filter and format the output.
ps aux | awk '{print $2, $1, $11}'
Why it works: `ps aux` lists all running processes in a user-friendly format. `awk` then processes this output line by line. By specifying `$2`, `$1`, and `$11`, we instruct `awk` to print only the second column (PID), the first column (USER), and the eleventh column (COMMAND), effectively giving us a concise, custom view.
Pro-Tip: To see more specific details like CPU and memory usage, you can adjust the column numbers in the `awk` command. For example, `$3` is %CPU and `$4` is %MEM.
Linux Tips & Tricks | © ngelinux.com | 6/20/2026
