awk

Process text by columns with pattern matching and arithmetic

awk processes text field by field. $1, $2... are fields (default separator: whitespace). awk '{print $2}' prints the second field of every line.

Example

$ ps aux | awk '{print $1, $2, $11}' | head -2
USER PID COMMAND
root 1 /sbin/init
Tip: Type it yourself in the terminal below - reading is not the same as doing.