Where's the love for awk? It has been tucked away in a sub item but doesn't deserve first class status?
$ time find -ls | awk '{s += $7} END {print s}'
15970582120
real 0m27.721s
user 0m1.256s
sys 0m1.780s
$ time find | xargs wc -c 2> /dev/null | tail -1
604260969 total
real 0m0.332s
user 0m0.068s
sys 0m0.204s $ find -print0 | xargs -0 wc -c 2> /dev/null | tail -1
(Also, many uses of find | xargs can be replaced with -exec cmd {} \; or -exec cmd {} +, e.g. $ find -exec wc -c {} + 2> /dev/null | tail -1
although this isn't much faster in this case.)Also, the results are different - though I'm too lazy to figure out why right now :)
find -type f -ls|awk '{s += $7} END {print s}'
find -type f -print0 | xargs -0 wc -c | tail -1
find -type f -exec wc -c {} + | tail -1