Search This Blog

Shell scripting: Sum file sizes

Linux

  • find . -type f -printf %s\\n | paste -sd+ | bc
  • find . -type f -printf %s\\n | numsum


Mac OS (BSD)

  • find . -type f -print0 | xargs -0 stat -f '%z ' | paste -sd+ - | bc

No comments:

Post a Comment