Taming `ps` Output with `awk` for Focused Process Info

Quick Tip

Taming `ps` Output with `awk` for Focused Process Info

Challenge: The output of the `ps` command can be overwhelming, especially on busy systems. Identifying specific processes or extracting particular information can be like finding a needle in a haystack.

The Solution: Leverage `awk` to filter and format the output of `ps` for targeted information retrieval.

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

Why it works: This command pipes the output of `ps aux` (which shows all processes with user, CPU, memory, etc.) to `awk`. `awk` then prints only the second column (PID) and the eleventh column (Command Name), making it much easier to quickly scan for process IDs and their associated commands.

Pro-Tip: To find processes using a specific command name, you can use `ps aux | awk ‘/nginx/ {print $2, $11}’` to show PIDs and command names only for processes containing “nginx”.

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

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted