Showing posts with label tips. Show all posts
Showing posts with label tips. Show all posts

Wednesday, March 3, 2010

UNIX sort by multiple columns

Sometimes the "obvious" stuff isn't so obvious (at least to me...)

I had a text file with multiple columns of numbers. I wanted to sort it by the first column, then the second, then the third. It wasn't immediately obvious to me how to do it. The man page for 'sort' of course does not mention that you can specify the '-k' option multiple times, and I didn't have the GNU 'info' utility installed:
sort -k1n -k2n -k3n file

Tuesday, January 5, 2010

Replace Cygwin command prompt with Puttycyg

I install Cygwin on every Windows machine that I have to use regularly. By default, Cygwin uses the Windows Command Prompt for its terminal. Gross!

I much prefer putty -- to the point that I would open putty and SSH to localhost, just so that I can use a real terminal!

With puttycyg, there's no need to SSH in. Donwload puttycyg and extract the ZIP. Then copy the two executables (putty.exe and cthelper.exe) into C:\cygwin (or wherever you have it installed).

Then, modify your cygwin.bat shortcut to run this target instead:
C:\cygwin\putty.exe -cygterm -

(yes that is a dash at the end!)