Site icon New Generation Enterprise Linux

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 overwhelming, especially on busy systems. Finding specific process information quickly can be like finding a needle in a haystack.

The Solution: Use awk to filter and format the ps output, focusing only on the columns 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) to awk. awk '{print $1, $2, $11}' then tells awk to only print the 1st, 2nd, and 11th fields, which typically correspond to the USER, PID, and COMMAND respectively. This drastically reduces the noise.

Pro-Tip: To find specific processes, combine this with grep. For example, ps aux | grep 'nginx' | awk '{print $1, $2, $11}'.

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

0 0 votes
Article Rating
Exit mobile version