Master `ps` Output with Custom `awk` Formatting
Quick Tip
Master `ps` Output with Custom `awk` Formatting
TITLE: Master `ps` Output with Custom `awk` Formatting
Challenge: The default output of the `ps` command can be overwhelming, often displaying more information than you need, making it difficult to quickly find specific process details like CPU or memory usage.
The Solution: Combine `ps` with `awk` to filter and format the output to show precisely the columns you want.
ps aux | awk '{print $1, $2, $3, $4, $11}'
Why it works: `ps aux` provides a comprehensive snapshot of running processes. `awk` then processes this output line by line, using its default field separator (whitespace) to extract specific columns (1 for user, 2 for PID, 3 for %CPU, 4 for %MEM, and 11 for the command name). This allows for highly customizable process monitoring.
Pro-Tip: For an even more concise view focused on PID, User, and Command, try: ps -eo pid,user,comm
Linux Tips & Tricks | © ngelinux.com | 6/10/2026
