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 overwhelming, filled with information you don’t need. You want to quickly see specific details like a process’s PID, user, and CPU usage.

The Solution: Combine ps with awk to filter and format the output.

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

Why it works: awk processes the output of ps line by line, and we instruct it to print specific columns (separated by whitespace by default). You can adjust the column numbers to display precisely the information you need.

Pro-Tip: Use ps -eo pid,user,pcpu,comm for a more concise and directly selectable set of common process details without needing awk in many cases.

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

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments