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 pinpoint specific process information like CPU usage, memory consumption, or parent process IDs.

The Solution: Leverage the power of `awk` to filter and format the output of `ps` for targeted information retrieval.

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

Why it works: This command pipes the comprehensive output of `ps aux` to `awk`. `awk` then processes each line, printing only the specified columns: USER ($1), PID ($2), %CPU ($4), %MEM ($6), and COMMAND ($11), providing a cleaner, more focused view.

Pro-Tip: To also see the parent process ID (PPID), you can include $3 in the `awk` print statement, for example: ps aux | awk '{print $1, $2, $3, $4, $6, $11}'

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

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted