Total number of lines in a directory

后端 未结 7 2014
礼貌的吻别
礼貌的吻别 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

提交回复
热议问题