Skip to content

Instantly share code, notes, and snippets.

@iamnewton
Created January 16, 2014 00:43
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 iamnewton/8447727 to your computer and use it in GitHub Desktop.
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.
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