Created
January 16, 2014 00:43
-
-
Save iamnewton/8447727 to your computer and use it in GitHub Desktop.
Allows you to grab the total size of the current working directory in bytes. Could be used as standalone script or within PS1.
This file contains hidden or 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
for filesize in $(ls -l . | grep "^-" | awk '{print $5}') | |
do | |
let totalsize=$totalsize+$filesize | |
done | |
printf "Total Size: $(tput bold)%s$(tput sgr0)\n" "$totalsize" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment