Site icon New Generation Enterprise Linux

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

Quick Tip

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

Challenge: The default output of the `ps` command can be overwhelming, making it difficult to find specific process information quickly. You often need to scroll through many columns to locate what you’re looking for.

The Solution: Combine `ps` with `awk` to filter and display only the columns you need, making process monitoring more efficient.

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

Why it works: This command pipes the output of `ps aux` (which shows all running processes) to `awk`. `awk ‘{print $1, $2, $11}’` tells `awk` to print the 1st, 2nd, and 11th columns, typically representing the USER, PID, and COMMAND respectively, giving you a concise view.

Pro-Tip: Use `ps -ef | awk ‘{print $3, $2, $8}’` for a different set of columns (UID, PID, COMMAND).

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

0 0 votes
Article Rating
Exit mobile version