Como encontrar os 10 maiores arquivos em um diretório usando um comando shell do Linux

Sem recursão

find-largest-files.sh
find . -maxdepth 1 -type f -exec du -h {} + 2>/dev/null | sort -rh | head -n 1

Com recursão

find-largest-files-recursive.sh
find . -type f -exec du -h {} + 2>/dev/null | sort -rh | head -n 10

Check out similar posts by category: Linux