Bash - number of columns in file (awk)

26 Aug 2017

awk '{print NF; exit}' filename.txt
[ bash  awk  ]