Monday, October 04, 2010

Techie Tidbits: Get Going with Cygwin

Installing Cygwin is a pretty straight forward exercise - but here I walk-through a few extra configuration steps that make Cygwin a real productivity catalyst for my day-to-day activities.
1st, Install Cygwin
Download the setup.exe file from here. I usually install to C:\Cygwin and stick all the package stuff in C:\Cygwin\.pkg, where I also stick the setup.exe, once I've initially finished with it.
2nd, relocate /home
Following any install or update, I always start up a shell and remove the /home directory and symlink to C:\Documents and Settings (this some how still works on Win 7, but we could easily use C:\Users):
cd /
rm -fr home
ln -s "C:\Documents and Settings" home
This now relieves you of having to maintain two home directories - after a while of using Cygwin you'll start to wonder why they didn't do this automatically.
3rd, add some Bash Here action
Cygwin has a wealth of command-line tools for text processing; that's great - I find these immensely useful when tweaking configuration files or batch processing server log files, for Apache say. The annoying bit is getting a shell open in the directory where you need to go to work: cue Chere!

In the Select Packages screen, search for and install both chere and mintty packages. If you happen to be reading this through once first, you can go ahead and do this step when you first install Cygwin (in step 1).

Now fire up a shell and enter the following command;

chere -ia1 -t mintty -s bash -e 'Bash Here'
Now you should be able to right click on any directory in Windows Explorer and have a Bash Here option
4th, spin up SSHD (skip this if you're asking 'What's SSHD?')
Errm, actually, I'll save this for another blog...

No comments: