Ubuntu – Showing file sizes in sorted order

command line

How to show a list of files from some directory root sorted in file size descending order from command line?

Best Answer

From your folder:

find . -maxdepth 1 -type f -exec du -h {} + | sort --human-numeric-sort --reverse

You can set how deep it can look for files with -maxdepth parameter or without it to be recursive.

Related Question