Master `ps` with `awk` for Focused Process Information

Quick Tip

Master `ps` with `awk` for Focused Process Information

Challenge: The output of the `ps` command can be verbose, making it difficult to quickly find specific information about running processes. You need a way to filter and format the `ps` output to display only the essential details you’re interested in.

The Solution: Pipe the output of `ps` to `awk` and specify the fields you want to see.

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

Why it works: This command uses `awk` to process each line of the `ps aux` output, printing only the specified columns: USER ($1), PID ($2), %CPU ($4), and COMMAND ($11). You can customize these column numbers to extract any information you need.

Pro-Tip: Combine this with `grep` to filter for specific process names, e.g., ps aux | grep nginx | awk '{print $1, $2, $4, $11}'.

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

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments