www.question-defense.com | Engage: Visit :: Login :: Register
Translate to English Übersetzen Sie zum Deutsch/German Переведите к русскому/Russian Μεταφράστε στα ελληνικά/Greek Vertaal aan het Nederlands/Dutch ترجمة الى العربية/Arabic 中文翻译/Chinese Traditional 中文翻译/Chinese Simplified 한국어에게 번역하십시오/Korean 日本語に翻訳しなさい /Japanese Traduza ao Português/Portuguese Traduca ad Italiano/Italian Traduisez au Français/French Traduzca al Español/Spanish
1

Alex and I got some new laptops the other day. I have been a Linux user primarily for many years but the laptop came with Windows 7 so I decided to give it a spin. I must say on the whole I have to say it is a very fast and usable operating system. There is just one thing I was missing and that was Linux shell commands in the terminal. Nothing fancy but I am so used to using ls,rm and grep that I almost went back to Linux. But then Alex mentioned something about adding Cygwin to his laptop which I am of course familiar with but he also mumbled about adding it to the path. I had never even considered this, so I did it and wow is it cool. All the commands I love are in my terminal now. Plus if you use console.exe you can have tabs and every thing.

Ok so on with the article:

First thing you have to do is install Cygwin. I am not going to get into that since it is pretty straight forward however the one thing which is important to note is the install path. the default is C:\cygwin which is what I use however every one does it a different way so I figured I should mention it. Here is a picture of the screen where the install location is defined.

cygwin41

Ok so we got Cygwin installed and working. The next thing we need to do is add the /bin directory of Cygwin to the path variable. This was a little confusing because when you are in the Cywin shell and type “which ls” which should tell you where the ls binary is. What it says is /usr/bin which is where it would be on a Linux/Unix machine but in reality all the binaries for Cygwin are in C:\cygwin\bin assuming you installed to the default location.

So, to add something to the path in Windows we just do this.

  1. From the desktop, right-click My Computer and click Properties.
  2. Click on the Advanced System Settings.
  3. Click the Environment Variables button.
  4. Finally, in the Environment Variables window highlight the Path variable in the
    Systems Variable section and click the Edit button. Add or modify the path lines with the paths you
    wish the computer to access. Each different directory is separated with a semicolon as shown below.

path11

Here you can see the exact syntax to add it to the  path after you select edit:

path21

In case you cant read it the it should look like this:
C:\cygwin\bin\;
It is really important to seperate commands in the path with a semi colon.

Ok so now to test this out. Open up a windows command prompt and try out a linux command.

cmd1

Ok so thats pretty cool, looks like ls and less are working. At this point we could be happy and stop but why would we do that when there is another tweak we can make to our windows install to make us Linux users feel more at home.

A few days ago Alex wrote a article here on console.exe which is a really cool little program which enhances the windows shell quite a bit. The most important part for me is tabs which is something I was really used to on my Gentoo laptop. I’m the kinda guy that has 20 tabs going at once.  So once you get console installed lets see what we are looking like now:

console21

I Just ran a few simple commands but you get the idea of how nice all these things can work together. Its little things like this that can make the difference in what operating system I use.  For now though I am quite happy with Windows 7 and I will be be bringing many more articles as I explore it more.

DeliciousStumbleUponDiggTwitterMixxTechnoratiFacebookNews VineLinkedInYahoo! Bookmarks
Related posts:
  1. Linux CLI Commands For Windows The best way I have found to emulate Linux commands...
  2. Windows 7 Cygwin: Sort: Input File Specified Two Times Earlier today I needed to use sort to output unique...
  3. How To Install SCP and SSH On Windows 7 Using Cygwin I use Cygwin on Windows to make my Windows only...
  4. How to Copy and Paste from the cygwin BASH Prompt By default cygwin’s BASH shortcut will not allow you to...
  5. How to Upgrade CYGWIN on Windows XP Upgrading cygwin is easy to do. Just visit cygwin.com and...

Tags: , , , , , , , , ,
One Response to “How to get a Linux Style Enviorment in Windows with Cygwin”
  1.  
Leave a Reply