sort -h

A friend  just showed me this cool new option for sort. You now can sort with -h, which works great with du -h.

du -hs * |  sort -h

Available since RHEL6 and current Fedora. Sorry no RHEL5.

This entry was posted in Enterprise Linux, Fedora, Linux and tagged . Bookmark the permalink.

2 Responses to sort -h

  1. Joe Buck says:

    sort -h first appeared in GNU sort in the August 2009 release, so Fedora’s had it for a long time. However, since RHEL 5 came out in 2007, its users have to put up with 5-year-old GNU tools.

    But the nice thing about text-oriented GNU tools is that it is dead easy to have multiple versions on your system and use your path to select, by just doing something like

    download coreutils 8.16
    ./configure –prefix=/opt/coreutils-8.16
    make
    sudo make install
    export PATH=/opt/coreutils-8.16/bin:$PATH

  2. Jens Kuehnel says:

    Hi Joe,
    yes, but I try not to depend on stuff not available out of the box. I was to long a Trainer and it sticks.

Leave a Reply

Your email address will not be published. Required fields are marked *