Tame Process Sprawl: Focused `ps` Output with `awk`

Quick Tip

Tame Process Sprawl: Focused `ps` Output with `awk`

Challenge: When dealing with a large number of running processes, the standard `ps aux` output can be overwhelming and make it difficult to quickly identify specific processes or information.

The Solution: Leverage the power of `awk` to filter and format `ps` output, allowing you to extract exactly the information you need.

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

Why it works: This command pipes the output of `ps aux` (which lists all running processes) into `awk`. `awk` then processes each line, printing only the second field (PID) and the eleventh field (Command Name), effectively simplifying the output to show just the process ID and its executable name.

Pro-Tip: To see processes by a specific user, pipe `ps aux` to `grep ‘username’` before piping to `awk`. For example: ps aux | grep 'johndoe' | awk '{print $2, $11}'

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

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted