Sunday, August 3, 2014

Find and sort files by size in human readable format

find /tmp -maxdepth 10 -size +100000 -exec du -sh {} \; 2>/dev/null | sort -n -k 1
55M    /tmp/wolf/Sleep Music _ 1h of Wolf Relaxing Sounds _ Sounds Sleep Music #1-ArFicwCRupU.mp3
56M    /tmp/wolf/☽ Night Sounds with Wolves and Fire-KfkqfhN2tjA.mp3
127M    /tmp/wolf/☽ Night Sounds with Wolves and Fire-KfkqfhN2tjA.mp4
174M    /tmp/wolf/Sleep Music _ 1h of Wolf Relaxing Sounds _ Sounds Sleep Music #1-ArFicwCRupU.mp4
290M    /tmp/wolf/4hr Thunderstorm with No Loops 'Sleep Sounds'-ywBxqqpyfOc.mp4.part
 

or if you want, w/+ append is marginally quicker if you dont run out of resources

find / -maxdepth 10 -size +100000 -exec du -sh {} + 2>/dev/null | sort -n -k 1

No comments:

Post a Comment