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:
Use find's internal stat to get the file size then let the shell add up the numbers.
Using find's internal stat to get the file size is about 50 times faster than using -exec stat.
Find files and calculate size with stat of result in shell