Dotfiles, utilities, and other apparatus.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
456 B

  1. #!/bin/sh
  2. # findsize - get size in Kb (I think) for a given name pattern to find(1).
  3. #
  4. # USAGE:
  5. #
  6. # findsize "*.jpg"
  7. #
  8. # find(1) options:
  9. # -iname "$1" does a case-insensitive name search for the pattern in $1
  10. # -print0 spits out null-delimited strings
  11. #
  12. # du(1) options:
  13. # -BK sets block size
  14. # --files0-from=- reads null-delimited filenames from stdin
  15. find . -iname "$1" -print0 | du -BK --files0-from=- | awk '{ a += $1 } END { print a }'