find large files

find large files under current mount point

2012-03-14

a small script to find large files under current mount point, useful in linux, probably works in bsd and generic unixes:

#!/bin/bash
#20091201:dmarsh:find large files under current mount point
#20100413:dmarsh:changed echo cmd to print -u2 so message goes to stderr
set -e
set -u
cmd="/usr/bin/find . -type f -size +1048576c -exec /usr/bin/du -sk {} \; 2>/dev/null | /usr/bin/sort -n"
print -u2 ${cmd}
eval ${cmd}