Taming `ps` with Custom `awk` Formatting

Quick Tip

Taming `ps` with Custom `awk` Formatting

Challenge: The default output of the ps command can be overwhelming, showing too much or too little information, making it difficult to quickly find the specific process details you need.

The Solution: Use awk to tailor the ps output to display exactly the columns you want, in the order you prefer.

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

Why it works: The ps aux command lists all running processes with user, CPU, and memory usage. awk then processes this output line by line, printing only the specified fields (User, PID, and Command in this example), allowing for highly customized process monitoring.

Pro-Tip: For a more concise and readable output of common process details, try ps -ef | awk '{print "User: " $1 ", PID: " $2 ", Command: " $8}'.

Linux Tips & Tricks | © ngelinux.com | 4/30/2026

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments