Command to find largest file.

Hi All,

Is there a direct Linux command to find the largest file by checking recursively in all the directories.

what do you mean by direct Linux command ?

we use, find for it, and we have discussed it lot of times before which is:

  1. Display five big files,
find . -type f -exec ls -s {} \; | sort -n -r | head -5
  1. Display files sorted by size
find . -type f -exec ls -s {} \; | sort -n -r 

Another one, but it will not be efficient as the one using find command as given by "thegeek"

ls -lR directory | sort -nk5 | awk 'END { print $NF }'

GNU find

$ find /home/ -type f -printf "%p:%s\n" | sort -t":" -k2 -n | tail -1