Tame Your `ps` Output: Focused Process Info with `awk`

Quick Tip

Tame Your `ps` Output: Focused Process Info with `awk`

Challenge: The default output of the `ps` command can be overwhelming, showing too much information about running processes. You often need to quickly find specific details like a process’s CPU usage, memory consumption, or parent process ID.

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

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

Why it works: `awk` allows you to specify which fields (columns) from the `ps aux` output you want to print. In this example, it shows PID, %CPU, %MEM, and the command name.

Pro-Tip: Use `ps -eo pid,ppid,%cpu,%mem,cmd` for a more structured and pre-defined column output that can also be piped to `awk`.

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

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted