Tame Your `ps` Output: Focused Process Info with `awk`

Quick Tip

Tame Your `ps` Output: Focused Process Info with `awk`

Challenge: The default `ps aux` or `ps -ef` output can be overwhelming, making it hard to quickly find specific process information like the command, PID, or CPU/memory usage.

The Solution: Combine `ps` with `awk` to precisely select and format the output you need.

ps aux | awk '{ print $1, $2, $11 }' # Shows USER, PID, and COMMAND

Why it works: `ps aux` lists all processes. `awk` then processes each line, using spaces as default delimiters. We then instruct `awk` to print specific fields (columns) by their numerical position: $1 (USER), $2 (PID), and $11 (COMMAND).

Pro-Tip: To find a specific command, you can pipe the output to `grep` or use `awk`’s pattern matching: `ps aux | awk ‘/nginx/{print $1, $2, $11}’`

Linux Tips & Tricks | © ngelinux.com | 6/5/2026

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted