Master `ps` Output with Custom `awk` Formatting

Quick Tip

Master `ps` Output with Custom `awk` Formatting

Challenge: The default output of the ps command can be verbose and difficult to parse for specific information, especially when dealing with a large number of processes.

The Solution: Leverage the power of awk to filter and format the output of ps for precisely the information you need.

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

Why it works: This command uses ps aux to list all running processes with detailed information and pipes the output to awk. awk then selectively prints specific columns (USER, PID, %CPU, %MEM, and COMMAND) using their positional indices, creating a much cleaner and more focused view.

Pro-Tip: To see only processes owned by a specific user, you can add a condition: ps aux | awk '$1 == "your_username" {print $1, $2, $11}'

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

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments