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

Quick Tip

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

Challenge: The output of the `ps` command can be incredibly verbose, making it difficult to quickly find specific process information like PID, CPU usage, or memory consumption.

The Solution: Combine `ps` with `awk` to filter and format the output, presenting only the most relevant columns.

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

Why it works: `ps aux` provides a comprehensive list of running processes. `awk` then processes this output line by line, printing only the specified columns (User, PID, %CPU, %MEM, and Command). You can customize the column numbers ($1, $2, etc.) to extract exactly what you need.

Pro-Tip: For a more human-readable format, you can pipe the output to `column -t` to align the columns neatly. Example: ps aux | awk '{print $1, $2, $3, $4, $11}' | column -t

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

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments