Here I am documenting my process for downloading, installing, and tweaking the settings for Cygwin, a Linux-based environment that runs on Windows. This is largely to help myself, so that I won't have to hunt down and rediscover processes and settings that I have already figured out in the past. However, I also want this to help as many people other than myself as possible. So lets dive into Cygwin.
DISCLAIMER: This guide assumes some knowledge about computers, such as the difference between 32-bit and 64-bit architectures and how to determine your computer's architecture.
This is the description of Cygwin from their own website:
- a large collection of GNU and Open Source tools which provide functionality similar to a Linux distribution on Windows.
- a DLL (cygwin1.dll) which provides substantial POSIX API functionality.
If that sounds like the kind of functionality that you want, then we are ready to get into the installation/tweaking process.
Start by navigating to cygwin's website to download the installer. Be sure to install the appropriate installer for your computer's architecture (e.g. 32-bit vs. 64-bit). Running the installer will take you through a series of questions:
- Download source should be Install from the Internet.
- Choose your settings for your Cygwin installation:
- Choose where your Root Directory will be. I always choose
C:\Program_Files\cygwin, for All Users. - All Users, or Just Me is your choice and is up to your installation needs and/or permissions you have on your machine.
- Next, you need to create a local folder for installation files. You can use any file location you want, but I typically use
C:\Program_Files\cygwin\local - Select your Internet Connection. I typically use the default, but if you have a preference, then feel free to use that for your download source. Next, if you chose the default, you need to pick a connection source to download from. My preference is to use .edu domains, because they are more trustworthy in my opinion. But please feel free to choose any source that you feel comfortable downloading from, or add your own URL.
- Now comes the fun part: Choosing which packages/libraries we want to download for our personal distribution.
- Choose where your Root Directory will be. I always choose
List of installed libraries/packages goes here...
So now that your libraries and packages are installed, Cygwin is ready to go. However, you will quickly notice that in order to run any of the new commands from your freshly installed libraries, you will have to run them from the Cygwin prompt rather than Windows' built-in cmd.exe command prompt. If you don't mind using the Cygwin prompt, then this is fine and your installation process is finished. However, if you would like to use cmd instead, then there is one more step to complete. We need to point the Path environment variable to where our Cygwin installation is stored in our filesystem so that cmd will be able to find the commands.
There are several ways to get to the environment variables, but I had to choose one so here is that process:
- From the start menu, open the Control Panel
- Go to System and Security
- Go to System
- On the left, click on Advanced system settings
- Go to Environment Variables...
- Under System variables, search for a variable named Path. Click on this and then click the Edit... button.
- Click New and enter the the file path to the bin folder of your Cygwin installation. For example, since I chose
C:\Program_Files\cygwinas my installation directory, then here I would typeC:\Program_Files\cygwin\bin - Now just click OK in all three of the open dialog boxes, and you will be ready to use linux commands from cmd!
To test things out, try opening cmd and running
pwdorls. You should get results back, and if you do get a message that these commands do not exist, then try closing and re-opening the cmd prompt, or run through these steps again.