Site icon New Generation Enterprise Linux

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

Quick Tip

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

Challenge: The `ps` command can produce a lot of output, making it difficult to quickly find specific information about running processes.

The Solution: Use `awk` to filter and format the `ps` output for precisely what you need.

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

Why it works: This command pipes the output of `ps aux` (which shows all processes for all users in a user-oriented format) to `awk`. `awk` then prints only the specified columns: the user (column 1), PID (column 2), and the command name (column 11).

Pro-Tip: To sort by CPU usage, pipe the output to sort -nrk 3 (e.g., ps aux | awk '{print $1, $2, $3, $11}' | sort -nrk 3).

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

0 0 votes
Article Rating
Exit mobile version