|
|
Linux and Windows don't mix - or at least they didn't before Cygwin. This article shows how to set up a Linux emulator running on Microsoft Windows.
In a recent blog Ian Douglas from the Daily Telegraph stated that 0.97% of the 13 million user's of the newspaper's web site used Linux, and many hardened Linux users may well wonder why that's so low, Undoubtedly part of the answer is the fact that moving from Windows to Linux is a major step. Well, not anymore - any Windows user can now incorporate Linux into their own PC just by installing a single application - Cygwin. What is Cygwin?Cygwin is a Linux emulator for Microsoft Windows, and as such does not support native Linux applications - in order for them to run they need to be ported to Windows, and this normally normally means rebuilding the application using Cygwin. Fortunately there have been a lot of very busy people and so the list of Linux tools and applications available to Cygwin is extensive. Installing CygwinCygwin installation is very simple and straightforward - the installation program can be found on the Cygwin web site - http://cygwin.com/; and then it's just a matter of doing the following:
Then, follow the on screen installation instructions. At the end of the process a 'default' system will have been installed - this consists of the minimum set of applications that is needed to emulate Linux. Starting CygwinOnce installed Cygwin can be started in any one of three ways:
The user will now be using Linux. An Example of Working with Linux in CygwinThere are far too many Linux tools to cover here, but one powerful element worth mentioning is Linux's file processing abilities. For example, the struture of one file - /etc/passwd/ - is quite complex: $ cat /etc/passwd admin:use_crypt:500:544:Administrator:/home/admin:/bin/bash bainm:use_crypt:552:544:bainm:/home/bainm:/bin/bash However, Linux tools such as gawk can extract data very easily: $ gawk -F: '{print $1,$6}' /etc/passwd admin /home/admin bainm /home/bainm In this example gawk has been instructed to use the colon as a field separator and then print the first and sixth fields. Adding Cygwin ApplicationsCygwin will have been installed in it's 'default' configuration - that's to say with the minimum number of tools needed to simulate a basic Linux system. However, more tools can be added as necessary, for example a few useful tools that are not installed by default are:
If any other tools are require then the user only has to rerun the installation program (setup.exe will have been downloaded during the installation process), and then selecting the appropriate files. Accessing Windows Files with CygwinEvery Windows user knows that the main drive in their PC is C: - but such a concept does not exist under Linux - on Linux there is no C: drive. However, this isn't a problem - Cygwin uses it's own mapping - C: is simply refered to as /cygdrive/c thereby allowing access to all files on the system. ConclusionCygwin, of course, is not Linux - it can't be; however, for anyone that has to stay with Microsoft Windows but still wants to benefit from the power of Linux then Cygwin is the perfect compromise.
The copyright of the article Cygwin: a Linux-like Environment for Windows in Computer Programming is owned by Mark Alexander Bain. Permission to republish Cygwin: a Linux-like Environment for Windows in print or online must be granted by the author in writing.
|
|
|
|
|
|
|
|