Monday, June 14, 2010

Unix sort by column

Sort is a very useful unix utility. Simplest usage is here::

ls | sort

but that's not very interesting. Let's say we want to sort all the files by size:

ls -l | sort -k5 -n

What this command does exactly sort by 5th field using numeric order. Another useful option you may use is -t which allows you to select the field separator.

1 comment:

  1. Slots 1x2 Casino & Sports Betting Platform - Royal Ascot
    Slots 1x2 is a how to get air jordan 18 retro red suede casino and good air jordan 18 retro men red sports betting platform offering a simple and secure way of playing and betting on the go. It's how can i get air jordan 18 retro racer blue simple and secure, bestest air jordan 18 retro varsity red it's what is the best air jordan 18 retro red fast,

    ReplyDelete