Tame Your Processes: Focused `ps` Output with `awk`

Quick Tip

Tame Your Processes: Focused `ps` Output with `awk`

Challenge: The default output of the ps command can be overwhelming, showing a lot of processes and details you don’t necessarily need. It’s hard to quickly find specific information about running processes.

The Solution: Combine ps with awk to filter and format the output for precisely the information you need.

ps aux | awk '{if ($1 ~ /your_user/) print $1, $2, $11}'

Why it works: This command pipes the output of ps aux (which shows all processes for all users with detailed information) to awk. awk then processes each line, printing only the username ($1), PID ($2), and command name ($11) for processes where the username ($1) matches “your_user”.

Pro-Tip: You can easily change the fields you want to display by modifying the numbers within the print statement (e.g., print $2, $4, $11 to show PID, CPU usage, and command).

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

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments