On 2014-11-18 11:54, Paul Heinlein wrote:
> On Tue, 18 Nov 2014, Yves Dorfsman wrote:
> 
>> On 2014-11-18 08:01, Ari Constancio wrote:
>>> On Tue, Nov 18, 2014 at 2:12 PM, Adam Moskowitz <[email protected]
>>>             du -ks * | sort -n | head -10
>>>
>>> $ du -sm *|sort -nr|head -n10
>>
>> If your systems support it (GNU coreutils does), have a look at the
>> human-readable option (-h):
>>
>> du -sh /blah |sort -h
> 
> I think Ari's goal was to list the ten largest directories; sort -n won't work
> as expected when piped output from du -sh.

`sort -h` understand human-readable numbers.

du -sh * |sort -rh |head -10
will provide the same result but with units (G, M, K).

-- 
Yves.
http://yves.zioup.com
gpg: 4096R/32B0F416

_______________________________________________
Tech mailing list
[email protected]
https://lists.lopsa.org/cgi-bin/mailman/listinfo/tech
This list provided by the League of Professional System Administrators
 http://lopsa.org/

Reply via email to