How to count lines in a document?

后端 未结 24 1429
慢半拍i
慢半拍i 2020-11-27 08:47

I have lines like these, and I want to know how many lines I actually have...

09:16:39 AM  all    2.00    0.00    4.00    0.00    0.00    0.00    0.00    0.0         


        
24条回答
  •  孤城傲影
    2020-11-27 09:14

    wc -l

    This will give you number of lines and filename in output.

    Eg.

    wc -l 24-11-2019-04-33-01-url_creator.log

    Output

    63 24-11-2019-04-33-01-url_creator.log

    Use

    wc -l |cut -d\ -f 1

    to get only number of lines in output.

    Eg.

    wc -l 24-11-2019-04-33-01-url_creator.log|cut -d\ -f 1

    Output

    63

提交回复
热议问题