Breaking News
Home / Sys Admin / Unix / How to sort the directories based on their sizes?

How to sort the directories based on their sizes?

Solution

Use the du command with the sort command as

$ du -s * | sort -rn

747624    work
23856    cards
7040    postie
680    convert
120    thumbs

This will list the the size in bytes for the directories in the current directory based on the descending order of their sizes.

[pb_builder]

Check Also

How to list disks information in Linux?

In order to check the disk in the system we can use the List Hardware …

Advertisment ad adsense adlogger