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

Quick Tip

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

Challenge: The default `ps` command can be overwhelming, showing too much information when you only need specific details about running processes.

The Solution: Pipe the output of `ps` to `awk` to select and format exactly the columns you want, such as PID, CPU usage, and command name.

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

Why it works: `ps aux` provides a comprehensive list of processes, and `awk` then processes each line, printing only the fields (columns) corresponding to the process ID (PID, column 2), CPU percentage (column 3), and command name (column 11).

Pro-Tip: Use `ps aux | grep ‘process_name’` to quickly find a specific process’s PID and then feed that PID into this `awk` command for detailed, filtered output.

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

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments