Skip to content

Instantly share code, notes, and snippets.

@arodbits
Created September 30, 2018 00:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arodbits/6e44ef34f8b038123eddf89ae5d3222f to your computer and use it in GitHub Desktop.
Save arodbits/6e44ef34f8b038123eddf89ae5d3222f to your computer and use it in GitHub Desktop.
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