Streamline Process Monitoring with `ps` and `awk`

Quick Tip

Streamline Process Monitoring with `ps` and `awk`

Challenge: You need to quickly extract specific information about running processes, such as their PIDs, command names, and CPU usage, without sifting through verbose `ps` output.

The Solution: Combine the power of `ps` with `awk` to filter and format the output.

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

Why it works: The `ps aux` command lists all running processes with detailed information. `awk` then processes this output line by line, printing only the second field (PID), the eleventh field (command name), and the third field (CPU percentage) for each process.

Pro-Tip: You can easily adapt the `awk` command to display other fields. Use `ps aux` and then `awk ‘{print $N}’` where N is the column number you’re interested in to discover more options.

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

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments