How do I count the number of rows and columns in a file using bash?

后端 未结 13 750
情深已故
情深已故 2020-12-23 03:09

Say I have a large file with many rows and many columns. I\'d like to find out how many rows and columns I have using bash.

13条回答
  •  没有蜡笔的小新
    2020-12-23 04:05

    If counting number of columns in the first is enough, try the following:

    awk -F'\t' '{print NF; exit}' myBigFile.tsv

    where \t is column delimiter.

提交回复
热议问题