Quick Tip
Taming `ps` Output: Focused Process Info with `awk`
Challenge: The output of the `ps` command can be verbose, making it difficult to quickly find specific process information like PID, command, or user.
The Solution: Combine `ps` with `awk` to filter and format the output for clarity.
ps aux | awk '{print $1, $2, $11}'
Why it works: `ps aux` lists all running processes with user, PID, and command. `awk ‘{print $1, $2, $11}’` then selects and prints only the first (USER), second (PID), and eleventh (COMMAND) fields from each line of the output, providing a cleaner, more focused view.
Pro-Tip: Use `ps -eo user,pid,comm` for a more direct way to select specific columns without relying on field numbers.
Linux Tips & Tricks | © ngelinux.com | 5/22/2026
