Chapter 4. Cygwin

Table of Contents
Get the files
Cygwin installation
Further reading
What keeps us sane in the badlands of the computing world

The Cygwin tools add a Unix-compatible API to any Win32 platform and allow you to use the GNU toolchain to port Unix/Linux programs to Win32 with little or no source code changes. Most of the common shells including bash run on Cygwin, as well as most of the common command-line utilities you'd expect to find on a Unix or Linux box. There is even a port of XFree86 and a couple of X applications if you prefer a GUI.

Cygwin uses a Unix-like directory hierarchy. The simplest setup is to mount the install root directory as root ("/"). This will then have the familiar subdirectories like /usr and /etc. Although you can access different drives (and files on the same drive, but outside the root hierarchy) with the /cygdrive/x/foo syntax, it may be simpler to mount drives that you access regularly. A great simplification is to mount the directory that contains all your user's home directories (e.g. c:\user or c:\WinNT\Profiles if you stick with the WinNT default) as /home.

Caution

You should always keep in mind that pure Win32 applications will understand neither the Cygwin mount table nor the Cygwin path notation. In some case we'll bend over backwards to keep both worlds happy.

Recent versions of Cygwin are split into various packages which can be updated separately. If you install for the first time, you should opt to install everything available except the Ghostscript package mentioned below. If you later update your installation, only new packages will be downloaded.

Get the files

  1. Jump to the Cygwin homepage and follow the link called Install now to setup.exe. Download the file (usually right click, Save as... in your web browser) to an empty directory. This directory will later hold all the archives that the installer downloads. Therefore you should not use a temporary directory for this purpose, but one that you keep in place, e.g. C:\User\Administrator\cygwin-install.