Site icon New Generation Enterprise Linux

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

Quick Tip

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

Challenge: The default `ps` command can produce a lot of information, making it difficult to quickly find specific processes or key metrics like CPU and memory usage. You often want to filter and format this output for better readability and analysis.

The Solution: Combine `ps` with `awk` to precisely select and format the columns you need.

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

Why it works: `ps aux` provides a comprehensive snapshot of running processes. `awk` then processes this output line by line, and we instruct it to print specific fields: `$1` (USER), `$2` (PID), `$4` (RSS – Resident Set Size), and `$11` (COMMAND). This provides a clean, focused view of essential process information.

Pro-Tip: To see only processes using more than 1% CPU, add a condition to `awk`: ps aux | awk '$3 > 1.0 {print $1, $2, $3, $11}'

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

0 0 votes
Article Rating
Exit mobile version