Mastering `ps` Output with Custom `awk` Formatting

Quick Tip

Mastering `ps` Output with Custom `awk` Formatting

Challenge: The default output of the `ps` command can be overwhelming, showing more information than you typically need. Extracting specific process details efficiently is a common need for system administrators.

The Solution: Use `awk` to filter and format the output of `ps` to display only the essential process information.

ps aux | awk '{print "User:", $1, "PID:", $2, "CPU:", $3 "%", "MEM:", $4 "%", "Command:", $11}'

Why it works: This command pipes the full output of `ps aux` to `awk`. `awk` then processes each line, printing specific fields (User, PID, CPU%, MEM%, and the Command) in a human-readable format.

Pro-Tip: For a more concise view focusing only on PID, User, and Command, try: ps -eo pid,user,comm

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

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments