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

Quick Tip

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

Challenge: The default output of the `ps` command can be overwhelming, especially when you’re looking for specific process details like PID, user, or command name. It often includes many columns you don’t need.

The Solution: Pipe `ps` output to `awk` to select and format only the columns you need.

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

Why it works: `awk` processes text line by line and can easily select specific fields (columns) based on their position. In this case, `$1` is USER, `$2` is PID, and `$11` is the COMMAND, giving you a concise view.

Pro-Tip: To also include the CPU and MEM usage, use ps aux | awk '{print $1, $2, $3, $4, $11}' which adds $3 (CPU%) and $4 (MEM%).

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

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments