Site icon New Generation Enterprise Linux

Tame Your Processes: Focused `ps` Output with `awk`

Quick Tip

Tame Your Processes: Focused `ps` Output with `awk`

Challenge: The default output of the ps command can be overwhelming, displaying a lot of information you might not need when trying to quickly identify specific processes by name or user.

The Solution: Combine ps aux with awk to filter and display only the columns you care about, such as the user, PID, and command name.

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

Why it works: ps aux provides a comprehensive list of running processes. awk then processes this output line by line, printing specific fields (columns) denoted by their position ($1 for user, $2 for PID, $11 for command in this common format). Adjust the column numbers if your ps output format differs.

Pro-Tip: To filter by a specific process name (e.g., “nginx”), you can pipe the output of awk to grep: ps aux | awk '{print $1, $2, $11}' | grep nginx.

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

0 0 votes
Article Rating
Exit mobile version