AWK useful commands

  1. print column n using a separator #awk -F# ‘{print $n}’
  2. print column 3 of lines that start with a number.: awk ‘/^[0-9]/ {print $3}’
  3. Variables:
    • NF: number of fields
    • NR: Number of record being processed
      • Avoid first record(row) and print last field (columnd): awk ‘{if(NR>1) print $NF}’: 

More about built-in variables: 8 Powerful Awk Built-in Variables

Some more tricks: https://twitter.com/b0rk/status/1000604334026055681