Oct 10, 2018

How to find the largest file in a directory and its subdirectories using the find command

find /path/to/dir/ -printf '%s %p\n'| sort -nr | head 

You can skip directories and only display files, type:
find /path/to/dir/ -type f -printf '%s %p\n'| sort -nr | head 
OR
find /path/to/dir/ -type f -iname "*.jpg" -printf '%s %p\n'| sort -nr | head