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

Quick Tip

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

Challenge: The output of the `ps` command can be overwhelmingly verbose, making it difficult to quickly identify specific processes or their resource usage.

The Solution: Combine `ps` with `awk` to filter and format the process information to your exact needs.

ps aux | awk '$1 == "user" { print $0 }' # Example: Show only processes owned by 'user'

Why it works: `awk` is a powerful text-processing tool that can parse lines and columns. By piping the output of `ps` to `awk` and specifying conditions (e.g., the first column `$1` equaling a username), you can precisely filter the results. The `print $0` directive prints the entire matching line.

Pro-Tip: Use `awk` to extract specific columns for even more targeted output, like `ps aux | awk ‘{print $2, $11}’` to show PID and command name.

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

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments