count number of columns in a file linux separated by tab code example Example: shell count number of columns awk '{print NF}' filename | sort -nu | tail -n 1