Created
January 30, 2019 15:08
-
-
Save 607011/fc034129ac05a92d7dbc328f0ee26e7d to your computer and use it in GitHub Desktop.
Sum up file sizes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
fileglob=. | |
total=0 | |
for size in $(ls -l ${fileglob} | tr -s ' ' | cut -d ' ' -f 5) ; do | |
total=$(( ${total} + ${size} )) | |
done | |
echo ${total} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment