Site icon New Generation Enterprise Linux

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.

The Solution: Combine `ps` with `awk` to filter and format the output for clarity.

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

Why it works: `ps aux` lists all running processes with user, PID, CPU usage, memory usage, and command. `awk` then selects and prints only specific columns (user, PID, %CPU, %MEM, command) for a more concise view.

Pro-Tip: For a more human-readable output, use `ps -eo user,pid,%cpu,%mem,command` instead of `ps aux` to directly specify the desired columns.

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

0 0 votes
Article Rating
Exit mobile version