Sort Directory by File Size
May 01, 2023 —
Gregg Szumowski
To sort files in a directory and to list them by the biggest file first:
$ du -a | sort -n -r | more
Alternatively you can use:
$ du -s * | sort -n -r | more
To sort files in a directory and to list them by the biggest file first:
$ du -a | sort -n -r | more
Alternatively you can use:
$ du -s * | sort -n -r | more