Quick Tip
Streamline `ps` Output: Focused Process Info with `awk`
Challenge: The default output of the ps command can be overwhelming, showing far more information than you typically need when trying to identify specific processes. This makes it difficult to quickly find the information you’re looking for.
The Solution: Leverage the power of awk to filter and format the ps command’s output, showing only the essential columns.
ps aux | awk '{print $1, $2, $3, $4, $11}'
Why it works: This command pipes the output of ps aux (which shows all processes for all users) into awk. awk then prints only the first, second, third, fourth, and eleventh fields, typically representing the USER, PID, %CPU, %MEM, and the COMMAND respectively, providing a concise overview.
Pro-Tip: You can easily customize the columns by changing the numbers in the awk print statement (e.g., awk '{print $2, $4, $12}' to see PID, %CPU, and Command Name).
Linux Tips & Tricks | © ngelinux.com | 6/22/2026
