Site icon New Generation Enterprise Linux

Taming `ps` Output with Custom `awk` Formatting

Quick Tip

Taming `ps` Output with Custom `awk` Formatting

Challenge: The default output of the `ps` command can be overwhelming, showing too much or too little information for quick analysis. You often need to sift through a lot of data to find specific processes or their resource usage.

The Solution: Use `awk` to precisely format and filter the output of `ps` to display only the information you need.

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

Why it works: `ps aux` lists all processes with detailed information. `awk` then selects specific columns (PID, %CPU, %MEM, COMMAND) to present a cleaner, more targeted view.

Pro-Tip: To see only processes owned by the current user, add a `grep` filter: ps aux | grep "^$(whoami)" | awk '{print $2, $3, $4, $11}'

Linux Tips & Tricks | © ngelinux.com | 5/14/2026

0 0 votes
Article Rating
Exit mobile version