Supercharge `ps` Output with Custom `awk` Formatting

Quick Tip

Supercharge `ps` Output with Custom `awk` Formatting

Challenge: The default output of the ps command can be verbose and difficult to parse when you need specific process information quickly. You often have to scroll or pipe it to other commands to get what you need.

The Solution: You can leverage awk to format the output of ps to display only the essential columns you care about.

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

Why it works: This command pipes the full output of ps aux to awk, which then prints only the first, second, and eleventh fields (typically USER, PID, and COMMAND respectively). You can customize the field numbers to select any information you need.

Pro-Tip: To add custom headers to your output, use ps aux | awk 'NR==1{print "USER\tPID\tCOMMAND"} NR>1{print $1"\t"$2"\t"$11}'.

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

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments