Quick Tip
Tame Your Processes: Focused `ps` Output with `awk`
Challenge: The output of the `ps` command can be overwhelming, filled with columns of information you don’t always need. It’s difficult to quickly pinpoint specific process details like CPU or memory usage.
The Solution: Combine `ps` with `awk` to filter and display only the columns you’re interested in.
ps aux | awk '{print $1, $2, $3, $4, $11}'
Why it works: `awk` processes the output of `ps aux` line by line and prints specific fields (columns) based on their numerical position. In this example, we’re selecting the User, PID, %CPU, %MEM, and Command columns, which are common and useful for a quick overview.
Pro-Tip: You can tailor the `awk` script to display any combination of columns. For instance, to see just the PID and Command, use: ps aux | awk '{print $2, $11}'
Linux Tips & Tricks | © ngelinux.com | 5/29/2026
