Site icon New Generation Enterprise Linux

Taming Process Monitoring with `ps` and `awk`

Quick Tip

Taming Process Monitoring with `ps` and `awk`

Challenge: The standard `ps` command can produce a lot of output, making it difficult to quickly find specific process information without sifting through irrelevant details.

The Solution: Combine `ps` with `awk` to precisely filter and format the process information you need.

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

Why it works: `ps aux` lists all running processes with user, CPU, memory usage, and command. `awk` then processes this output line by line, printing only the specified columns (user, PID, and command name in this example), giving you a cleaner, more targeted view.

Pro-Tip: For even more specific filtering, you can add conditions to `awk`, like `ps aux | awk ‘$1 == “root” {print $2, $11}’` to see only processes run by the ‘root’ user.

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

0 0 votes
Article Rating
Exit mobile version