Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
add up all column values
res=0; for dir in $a; do val=$(du -s /dir_path | awk '{ print $1 }'); res=$(($val+$res)); done;
#The result is in KB by default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment