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

后端 未结 13 1267
深忆病人
深忆病人 2020-12-23 03:07

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 03:55

    awk 'BEGIN{FS=","}END{print "COLUMN NO: "NF " ROWS NO: "NR}' file
    

    You can use any delimiter as field separator and can find numbers of ROWS and columns

提交回复
热议问题