Quote:
Originally Posted by mhbd
3 ./1/target
3 ./2/target
0 ./3/target
0 ./4/target
3 ./5/target
The count is 9
It's correct, 9Kb (3+3+0+0+3):
find . -type d -name kk -exec du -sk {} \;
searches for directories called "kk" and executes one "du -sk" for each.
Its output is passed to:
awk '{count+=$1; print}END {print "The count is ",count}'
This command shows you each line while it summs each "du" value to finally display the result.
What's wrong?