Site icon New Generation Enterprise Linux

Taming Process Sprawl: Focused `ps` Output with `awk`

Quick Tip

Taming Process Sprawl: Focused `ps` Output with `awk`

Challenge: When dealing with a multitude of running processes on a Linux system, the standard `ps aux` output can be overwhelming and difficult to parse for specific information.

The Solution: Leverage the power of `awk` to filter and format the output of the `ps` command, allowing you to pinpoint exactly the process information you need.

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

Why it works: This command pipes the full `ps aux` output to `awk`. `awk` then processes each line and prints only the first field (USER), second field (PID), and eleventh field (COMMAND), effectively filtering out irrelevant columns and providing a cleaner, more focused view.

Pro-Tip: To filter processes by a specific user, you can add a condition to `awk`: `ps aux | awk -v user=”your_username” ‘$1 == user {print $1, $2, $11}’`

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

0 0 votes
Article Rating
Exit mobile version