bug-coreutils
[Top][All Lists]
Advanced

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

option for sort: sort human readable file sizes


From: Cornelis de Gier
Subject: option for sort: sort human readable file sizes
Date: Tue, 10 Feb 2004 20:29:39 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040113


du, df and ls all have an option -h or --human-readable which is very helpful displaying large file sizes. I didn't know of an easy way to sort the output of this option, so I wrote a -h option for sort. It's very helpful to identify large directories in a command like this:

du -h | sort -h

...
800K    /var/cache/man
924K    /var/www/icons
948K    /var/cache/yum/nluug-updates-released/headers
1.1M    /var/lib/scrollkeeper/index
...

I'm willing to share my implementation if you're interested.

Cornelis





reply via email to

[Prev in Thread] Current Thread [Next in Thread]