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 standard `ps` command can be overwhelmingly verbose, making it difficult to quickly pinpoint specific process information like CPU usage, memory consumption, or command arguments.

The Solution: Combine `ps` with `awk` for selective and formatted output.

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

Why it works: `ps aux` provides a comprehensive snapshot of all running processes. `awk` then processes this output line by line, printing only the specified columns (USER, PID, %CPU, %MEM, COMMAND in this example). You can customize the column numbers to extract precisely the data you need.

Pro-Tip: To filter for processes owned by a specific user, you can add a condition to `awk`: ps aux | awk '$1 == "your_username" {print $1, $2, $3, $4, $11}'

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

0 0 votes
Article Rating
Exit mobile version