Tame Your Processes: Focused `ps` Output with `awk`

Quick Tip

Tame Your Processes: Focused `ps` Output with `awk`

Challenge: The output of the `ps` command can be overwhelmingly verbose, making it difficult to quickly find specific process information like PID, command name, or CPU usage.

The Solution: Combine `ps` with `awk` to filter and format the output, displaying only the columns you need.

ps aux | awk '{print $1, $2, $11}'

Why it works: `ps aux` provides a comprehensive list of running processes. `awk` then processes this output line by line, printing only the first ($1 for USER), second ($2 for PID), and eleventh ($11 for COMMAND) fields, effectively creating a more digestible view.

Pro-Tip: To see CPU and memory usage alongside the command, try `ps aux | awk ‘{print $1, $2, $3, $4, $11}’` (USER, PID, %CPU, %MEM, COMMAND).

Linux Tips & Tricks | © ngelinux.com | 7/4/2026

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted