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

Quick Tip

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

Challenge: When you run the `ps` command to list running processes, the output can be overwhelming and difficult to parse for specific information.

The Solution: Combine `ps` with `awk` to filter and display only the columns you need, making it easier to monitor specific process attributes.

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

Why it works: `ps aux` provides a comprehensive list of processes, and `awk ‘{print $1, $2, $11}’` then selects and prints only the first (user), second (PID), and eleventh (command) fields from each line of the `ps` output.

Pro-Tip: To see only the PIDs of processes owned by a specific user, use: ps aux | awk -v user="yourusername" '$1 == user {print $2}'

Linux Tips & Tricks | © ngelinux.com | 7/1/2026

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted