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 verbose and overwhelming, making it difficult to quickly find specific information about running processes.

The Solution: Use `awk` to filter and format the `ps` output to display only the columns you need.

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

Why it works: `awk` is a powerful text-processing tool that can parse lines of input based on delimiters (spaces by default) and print specific fields. In this case, we’re selecting the username, PID, CPU usage, and command name.

Pro-Tip: You can customize the columns by changing the numbers after the ‘$’ sign in the `awk` command. For example, `$1` is the first column, `$2` is the second, and so on.

Linux Tips & Tricks | © ngelinux.com | 6/25/2026

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted