[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Sorting directories by size



On Sat, Feb 28, 2015 at 01:15:42PM +0100, Petter Adsen wrote:
> I want to do a "du -sh *" in a directory, and sort the directories by
> sizes. The problem is that they are listed (since I use the "-h"
> option) in human-readable format. Is there an easy way to do this, so
> that 254G comes before 1,3T?
> 
> I'm guessing I would need some sort of regexp, and I don't know those
> at all (well, barely).
> 
> Any help would be appreciated!

What did Google find?

e.g. A quick google search found this:
http://stackoverflow.com/questions/7463554/bash-how-can-i-list-out-the-size-of-each-file-and-directory-recursively-and-s

-- 
"If you're not careful, the newspapers will have you hating the people
who are being oppressed, and loving the people who are doing the 
oppressing." --- Malcolm X


Reply to: