I am using this command to find the folders I want and count up the size. find . -type d -name 'tmp_c*' | xargs du -hcs {} \; + My version of find does not support -exec. But, this works. However I am not sure if its giving me the right totals on the directories that contain my search string. When I run the command and pipe to less, I see it counting up each folders size, and then it outputs a total every so often. Like this:140K    ./r/g/userid/attach/tmp_c_241091464_268K     ./r/g/userid/attach/tmp_c_58367014_undefined2.3G    totalIf I redirect the output to a file then grep on total, I get this:2.3G    total978M    total1.1G    total2.0G    total1.1G    totalI think this is giving me the right numbers. But how can I take this command one step further and have it sum up the totals for a grand total on one line?
Find size of directories recursively and get a total
find;directory;disk usage