Master `ps` Output with `awk` for Focused Process Info

Quick Tip

Master `ps` Output with `awk` for Focused Process Info

Challenge: The default output of the `ps` command can be overwhelming, displaying a lot of information you might not need when trying to identify specific processes or their resource usage.

The Solution: Combine `ps` with `awk` to precisely select and format the columns you’re interested in.

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

Why it works: `ps aux` provides a comprehensive view of all running processes. `awk` then processes this output line by line, and we instruct it to print only specific fields (column numbers) representing user, PID, CPU usage, and command name.

Pro-Tip: Use `ps -eo user,pid,%cpu,%mem,cmd` for a cleaner, built-in way to select columns without `awk` if your needs are simple.

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

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments