Site icon New Generation Enterprise Linux

Master Process Monitoring with `ps` and `awk`

Quick Tip

Master Process Monitoring with `ps` and `awk`

Challenge: Getting a clear, focused view of processes on your Linux system can be overwhelming with the default `ps` output, which often includes more information than you need.

The Solution: Use `ps` in conjunction with `awk` to filter and format the process information precisely to your requirements.

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

Why it works: `ps aux` provides a detailed snapshot of all running processes. `awk` then processes this output line by line, printing only the process ID (column 2), the command (column 11), and the CPU usage (column 3) for each process, giving you a clean and informative view.

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

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

0 0 votes
Article Rating
Exit mobile version