Why does “find . -name *.txt | xargs du -hc” give multiple totals?

前端 未结 7 1053
长发绾君心
长发绾君心 2020-12-30 10:12

I have a large set of directories for which I\'m trying to calculate the sum total size of several hundred .txt files. I tried this, which mostly works:

fin         


        
7条回答
  •  青春惊慌失措
    2020-12-30 10:46

    xargs busts its input into reasonable-sized chunks - what you're seeing are totals for each of those chunks. Check the man page for xargs on ways to configure its handling of input.

提交回复
热议问题