Tim's blah blah blah

Find large files Linux/macOS

These are some commands to find large files on Linux/macOS. You might need GNU find for some (hence the g prefix)

Find large files, get filename

find . -type f -name IMG\*MOV -size +25M

Find large files, get filename & filesize

find . -type f -name IMG\*MOV -size +10M -print0 | gdu --files0-from=- -hc

Find large files, get filename, filesize, and date

gfind . -type f -name IMG\*MOV -size +10M -printf '%TY-%Tm-%Td %s %f\n'

Find large files in current dir, check if they exist elsewhere on the system. Need to get only filename without path (’./’) here.

gfind . -type f -name IMG\*MOV -size +10M -printf '%TY-%Tm-%Td %s %p\n ' -exec sh -c 'gfind ~/Pictures/ -name $(basename "$0")' '{}' ';'
gfind . -type f -name IMG\*HEIC -size +2M -printf '%TY-%Tm-%Td %s %p\n ' -exec sh -c 'gfind ~/Pictures/ -name $(basename "$0")' '{}' ';'

find . -type f -name IMG\*HEIC -size +2000k -print0

Find files, group by modification date, calculate filesize.

gfind ./ -maxdepth 1 -type f -printf '%TY-%Tm-%Td %s\n'|awk '{sum[$1]+= $2;}END{for (date in sum){print date, sum[date];}}'|sort

#Linux #Mac