commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
There are 10 alternatives - vote for the best!
Even simpler! Use du ... the -s and -c flags summarize and print a grand total of all files recursively. The -b flag prints in byte format. You can use the -h flag instead to print in human readable format.
Computes total size of files in a directory. This value is different "du -b" because doesn't includes directory sizes.
| sed "s/$/\/(1024\*1024\*1024)/" | bc
to get size in GB
If you can do better, submit your command here.
You must be signed in to comment.