Streamline Process Monitoring with `ps` and `awk`

Quick Tip

Streamline Process Monitoring with `ps` and `awk`

Challenge: The output of the ps command can be overwhelming, making it difficult to extract specific information about running processes. You often need to filter and format this data to pinpoint crucial details like process ID (PID), command name, and CPU/memory usage.

The Solution: Combine the power of ps with awk for precise process monitoring.

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

Why it works: This command first lists all running processes in a detailed format (ps aux). Then, awk is used to select and print only the second column (PID) and the eleventh column (command name) from the output, providing a clean, targeted view of your running processes.

Pro-Tip: To also see the CPU usage (typically the 3rd column), modify the awk command to ps aux | awk '{print $2, $3, $11}'.

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

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted