Using awk is best if there is more than just the column as per your example, or you can use "cut" to extract the specific column and do it in the shell
x=0
for i in `du -sk * | cut -f1`
do
x=$(( x + i ))
done
echo $x
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.