Tame Your `ps` Output: Focused Process Info with `awk`

Quick Tip

Tame Your `ps` Output: Focused Process Info with `awk`

Challenge: The output of the ps command can be incredibly verbose, making it difficult to quickly find the specific information you need about running processes, especially when you only care about a few key details.

The Solution: Combine ps with awk to precisely select and format the columns you want to see.

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

Why it works: This command pipes the output of ps aux (which shows all processes with user, CPU, and memory usage) to awk. awk then processes each line, printing only the first column (USER), the second column (PID), and the eleventh column (COMMAND), effectively filtering and reformatting the output for clarity.

Pro-Tip: To see only processes owned by a specific user, use ps -u username | awk '{print $1, $2, $11}'.

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

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted