Linux du Sort: Largest to Smallest

To sort files or directories from largest to smallest, you can use the following command combined with the sort command:

du -sh * | sort -rh

Here, the du -sh command is used to list the sizes of all files and directories in the current directory in a human-readable format, and the sort -rh command is used to sort them from largest to smallest.

bannerAds