Master `ps` Output with `awk` for Focused Process Info

Quick Tip

Master `ps` Output with `awk` for Focused Process Info

Challenge: The `ps` command provides a wealth of information about running processes, but it can be overwhelming and difficult to extract only the specific details you need, like a process ID (PID) or command name.

The Solution: Combine `ps` with `awk` to filter and format the output, displaying only the columns you care about.

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

Why it works: `ps aux` lists all processes with user, CPU/memory usage, and command. `awk ‘{print $1, $2, $11}’` then processes this output line by line, printing only the first column (user), second column (PID), and eleventh column (command name).

Pro-Tip: To find a specific process, you can pipe the output of `awk` to `grep`. For example, to find all processes run by the ‘nginx’ user: ps aux | awk '{print $1, $2, $11}' | grep '^nginx'

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

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted