Most of the traffic to my blog is from search engines for a few informative posts that I made a while ago. So here goes my attempt at “informative posts” with the sole selfish intention of increasing my blog traffic. This blog is going to be lesser of a rant corner and turn more into the technical flavour it was initially intended to be. I hadn’t been the biggest fan of Windows through college. But now I use Windows a lot. I am going to writing a series of posts over the next couple of weeks detailing the steps for hardcore unix users to make his/her life comfortable in the Windows world.
In this post, I will detail how to bring the familiar unix command line shells and utilities to your windows desktop. There are two ways to achieve this, the first is to install the Microsoft Services for UNIX package, and the other is to install Cygwin. I am not familiar with the former, but I believe Cygwin is a more comprehensive solution.
- Cygwin is a unix shell emulator for Windows. You can get your copy of Cygwin from http://cygwin.com. Run the Setup.exe file from the site, choose “Install from Internet”, and choose a nearby mirror.
- In the package choosing dialog, select applications you think you would need. I would suggest that you also additionally select the X11 system, GNU Screen, the rxvt terminal emulator and the zsh shell. After selecting the packages, go and get more than 1 cup of coffee, for it takes ages to finish the download and install.
- If you are running Windows Vista, you have 1 more additional step to get cygwin running fine. Open command prompt, go to your cygwin installation directory, and run “bin/ash” (without the quotes). This will start the ash shell. Now, from the ash prompt, run “bin/rebaseall” (again without the quotes). You can then quit the shell by typing exit at the ash prompt. If you do not do this, you might face memory protection problems when launching cygwin applications.
- Now that you have cygwin running in a hale and healthy manner, we need a nicer terminal to run cygwin in, rather than the ugly cmd.exe. Browse over to http://en.poderosa.org/ and install Poderosa, for a tabbed and resizeable cygwin terminal. I would dubb Poderosa the best thing since sliced bread but then you wouldn’t believe me till you try it yourself.
- Now, open Poderosa. Select File->New Cygwin Connection... In the dialog that appears; if you want to work with bash, then just hit OK, and you will be presented with a bash shell. Or if you want to use zsh (or any other shell), select Advanced configuration and change the shell from /bin/bash -i -l to /bin/zsh -i -l and hit OK.
- Now, that cygwin and poderosa are setup, we just need to get some config files set right. You will see a warning message appear on the shell, when you initially start it. http://www.cygwin.com/cygwin-ug-net/using-utils.html suggests that you run the following command to solve this.
mkgroup -l > /etc/group
mkpasswd -l > /etc/passwdIf you are on a domain, add a -c option to the above commands
- As to what are the advantages of Poderosa:
- Resizeable windows
- Tabbed interface
- Vertical and Horizontal splitting of the screen
- Plugin based architecture
- Supports SSH connections, so it can also replace putty
- However, if you don’t like Poderosa, but still want a terminal better than cmd.exe, run rxvt from the the command line, to get the rxvt terminal. While, I will keep details of configuring rxvt for best benefits to a later post, it would do good to know some basic info about rxvt beforehand, for instance pasting in rxvt is accomplished by the key combination Shift+Insert.
- One last tuning tip, is to add the Cygwin bin directory to your Windows PATH variable. To do this, right click on My Computer, choose the Advanced tab, click Environment Variables. Under the System Variables pane, select Path and click Edit. At the end of the Variable Value string, add a semicolon(’;') and type in the installation path of Cygwin followed by a “\bin”. For example, add “;c:\cygwin\bin” (without the quotes). Click OK through all the dialog boxes. And, now you will be able to access Cygwin utilities from the the Windows (dos?) command prompt too.
Planned posts in this series include Tuning X11 for cygwin, rxvt for Windows, ZSH for productivity, Tuning GNU Screen for command line geeks and Explaning my Emacs configuration.

Recent Comments