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

Quick Tip

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

Challenge: The output of the `ps aux` command can be overwhelming, making it difficult to quickly find specific information about running processes. Often, we need to extract just a few key columns.

The Solution: Combine `ps` with `awk` to select and display only the desired columns.

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

Why it works: `ps aux` lists all processes with detailed information, and `awk` then processes this output line by line. We tell `awk` to print only the first ($1), second ($2), and eleventh ($11) fields, which typically correspond to the User, PID, and Command respectively.

Pro-Tip: Use `ps -eo user,pid,cmd` for a more direct way to select specific columns without needing `awk` in many cases.

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

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments