Quick Tip
Tame `ps` Output: Focused Process Info with `awk`
Challenge: The `ps` command, while powerful for listing processes, can produce overwhelming amounts of output, making it difficult to pinpoint specific information like CPU usage, memory, or command name.
The Solution: Pipe the output of `ps` to `awk` to select and format only the columns you need.
ps aux | awk '{print $1, $4, $11}'
Why it works: `ps aux` lists all processes with user, CPU, and memory details. `awk` then processes this output line by line, and the `'{print $1, $4, $11}’` part instructs it to print only the first field (user), fourth field (CPU usage percentage), and eleventh field (command name). You can adjust the field numbers to include other desired information.
Pro-Tip: For real-time updates, wrap this command in `watch` like so: `watch -n 1 “ps aux | awk ‘{print \$1, \$4, \$11}'”`. Remember to escape the dollar signs within the `watch` command.
Linux Tips & Tricks | © ngelinux.com | 5/30/2026
