awk

  • File manipulation

  • Reads from std in and writes to std out

  • Basically does the operation between {...} on every line

Identity Op

cat README.md | awk '{print $0}'
OR
awk '{print $0}' README.md

Variables

$0 - WHOLE LINE

$1, $2, $3 - index for line split by whitespace

$NF - last field

$(NF-2)

NR is row number

Change Field Seperator

Splits on colon for $1, $2, $3

Get Text between two text

If

Culumulative

Other Examples

Last updated