sort -h
I recently discovered the
-hswitch of GNU sort, added in the coreutils 7.5 release from Aug 20, 2009. With this switch,sortwill do a numeric sort of human-readable size numbers, i.e. it will accept “42M” and “1.3G” as numbers and put them in the right order.
Alas, Mac OS X ships with the 5.93 version of sort from 2005.
3 Comments
Let's hope someone find a security flaw in this tool to get it updated :-)
gogo gadget "brew install coreutils" ;)
Stay up-to-date by subscribing to the Comments RSS Feed for this post.
MacPorts to the rescue?