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

Quick Tip

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

Challenge: The standard `ps` command can produce a lot of output, making it hard to find specific process information quickly. You often want to filter or reformat this output to see only what’s relevant.

The Solution: Combine the power of `ps` with `awk` to precisely select and display the information you need.

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

Why it works: `ps aux` lists all running processes with detailed information. `awk` then processes this output line by line, and `{print $1, $2, $11}` prints only the first, second, and eleventh fields (typically USER, PID, and COMMAND), allowing you to quickly see essential process details.

Pro-Tip: Use `ps -eo user,pid,comm | grep your_process_name` for a more direct search if you know the process name.
Linux Tips & Tricks | © ngelinux.com | 6/11/2026

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted