Total number of lines in a directory

后端 未结 7 2020
礼貌的吻别
礼貌的吻别 2021-01-13 08:52

I have a directory with thousands of files (100K for now). When I use wc -l ./*, I\'ll get:

 c1            ./test1.txt
 c2            ./tes         


        
相关标签:
7条回答
  • 2021-01-13 09:38

    iF you want to know only total number Lines in directory excluding total line

    ls -ltr | sed -n '/total/!p' | awk '{print NR}'
    

    Previous comment will give total count of lines which includes only count of lines in all files

    0 讨论(0)
提交回复
热议问题