How To: Get Linux Power on Your Windows PC with Cygwin
We believe that everyone who considers themselves a computer enthusiast should have at least some experience with a Linux environment, but it can be daunting to just jump into the deep end of a completely unfamiliar operating system. One way to get your feet wet is with Cygwin, a free program that provides you with a Unix-like command line, without having to leave Windows. Cygwin is not a Unix emulator (it cannot run native Unix programs, although it does contain the tools needed to compile and run a program from source code), but it does have a wide array of optional packages that let you use most of the tools and utilities that you would commonly use in Unix, in Windows. In this guide, we’ll show you how to get Cygwin set up, the basics of how to navigate a Unix file system, and how to find more information as you need it.
1. Install Cygwin
To get started with Cygwin, go to www.cygwin.com and click the link that says “Install or update now.” Run the setup.exe program that gets downloaded, and when asked, select the Install from Internet radial button. The location that you choose to install Cygwin to is important, because that same folder will (by default) act as the root of your simulated Unix file system. In other words, pick somewhere with a little extra disk space. You’ll be asked where to store the downloaded installation files (anywhere’s fine, as long as you have enough room to handle what can be a gig or two of optional packages) and what kind of connection type you use. For most people, the Direct Connection setting will be fine.

(Image A)
You’ll also be asked to choose a mirror to download Cygwin from (image A). You can choose one at random if you want, but since the download might be pretty sizeable (depending on what components you choose to install) it could be worth your time to check out the official mirror list at www.cygwin.com/mirrors.html and select one that’s located close to you. You can copy-paste mirror addresses to the User URL field at the bottom of the window.
There will be a short download, then you’ll get to the meatiest part of the installation process—the package selector (image B). Here, you’ll select which packages you want to download with Cygwin. These packages define what functionality Cygwin will have once installed, and there are a lot of them. If your goal right now is to just get your toes wet and see what this whole thing’s about, you can leave only the defaults selected, which will provide basic command-line functionality. We’ll also show you how you can add any of these packages at any time, so don’t worry that you’re passing up something you’ll need later.

(Image B)
Click through the rest of the installer, and wait for Cygwin to download and install the files it needs. Save the setup.exe file somewhere, because you’ll need it if you want to install more packages in the future.
2. Run Cygwin
Now that you’ve installed Cygwin, run it by clicking its entry in the Start menu. You’ll see a window with the bash shell running—the same shell used by GNU Linux (image C). You should see some configuration files, your Windows user name (which is also your Cygwin username, by default), and a dollar sign, which is the start of the command line. The ~ after your user name shows that your current directory is the home directory—think of it as C:\ in Windows.

(Image C)
That said, the home directory that you’re looking at in Cygwin is not C:\, but a folder in your Cygwin directory. By default, your home directory is located in C:\Cygwin\home\[your user name] in the Windows directory tree, and all folders and files you create will be in there. To test this, type mkdir test into the command line, then hit Enter. This is the Linux equivalent of the Windows mk command, and creates a directory in the current active folder, using the argument as a name.
To see the directory you just created, type ls. This displays the contents of the current folder—the equivalent of the Windows dir command. You should see your test directory. To switch to that directory, type cd test just like you would in Windows. To return to your home directory, type cd ~ at any time.
Here are some other basic commands you’ll need to navigate Cygwin (and Linux):
del [file] – Delete [file]cp [file] [directory] – Make a copy of [file] and put it in [directory]mv [file] [directory] – Move [file] to [directory].
3. Learn Your Way Around New Programs

(Image D)
So, that’s the basics of navigating around the Cygwin file structure. Of course, if you want to do anything more than shuffle file structures around, you’ll need to install more packages. For instance, if you want a more powerful text/code editor, you might do a search and find out there’s a very well-regarded program called Emacs available. To download the package, just run the setup.exe program that you used to install Cygwin, and click through to the package selection screen. Packages you downloaded the first time around will be marked Keep (image D) and everything else will say Skip. Find the Emacs package, and click Skip, so that it changes to a version number to download. Finish the setup.exe program, and you’ll now have a new text editor for Cygwin. To test it out, type emacs test.txt—the Emacs editor will open (image E). But getting around Emacs is pretty tough at first—there are tons of hotkeys to memorize. So how do you use it? For that matter, how do you use any of these programs?

(Image E)
Obviously, we can’t tell you how to use every command—even a thorough walkthrough of a single complicated command wouldn’t fit into this article. Instead, we’ll give you a quick primer on how to educate yourself. If you’ve got a command that you think you’d like to use, but you aren’t sure how, entering the command man followed by that command (for instance: man emacs) will show you the manual page for the command (image F), including a description of what it does, what sort of syntax it takes, and which flags it can accept. In the manual display, scroll down through the document with the space or E key, and scroll up with W or Y. If you want information about a certain topic, but don’t know the name of the specific command, use man -K [search term] to search through all manual pages.

(Image F)
Comments
Comments are closed on this article
![]()
borse
December 16, 2010 at 3:38am
Il migliore di questi sacchetti della replica di gucci borse, infatti, non sono solo fatte per assomigliare veline di originale borse di outlet gucci, ma sono anche progettati con le caratteristiche di qualità di altri (oltre a buona estetica) che fanno borse di Louis Vuitton Outlet così popolare. Le caratteristiche in questione qui includono cose come la durata e la buona esecuzione a mettere insieme i vari elementi della replica borse, perché l'ultima cosa che si desidera avere un Gucci handbag la cui chiusura lampo cade per la prima volta si fanno uso di esso.
Quindi, se si effettua una accurata scelta dei sacchetti della replica di louis vuitton borse, è probabile che finire con una borsa che non guarda solo come un originale Gucci, ma anche una borsa che ha alcune delle caratteristiche intrinseche che lo rendono così affascinante Gucci.
![]()
PCLinuxguy
September 21, 2010 at 5:23pm
I agree. If you want to use linux then just do it. Dual boot it or use a Virtual Machine or Wubi and try it and if you like it you can still dual boot or just redo the HDD with it as the only OS on there. Though I wonder if Windows users know that there is already a command prompt built into Windows already and might do the same thing assuming they knew what they were doing in a command prompt in general because if you don't then you might muck up the machine either way.
![]()
apexwm
September 03, 2010 at 12:48pm
In all honesty, nowadays Linux is very easy to install and run with. Distributions like Ubuntu and Fedora are completely graphical and you generally don't even need the command line on them. In my opinion, if you need to make up for what is lacking in Windows, why even stay on Windows? To the comments about installing drivers and supposed complexity of Linux, have you used Linux in the past 8 years? I actually have found it to be the opposite as stated.... I've rarely needed to manually install drivers in Linux (including printer drivers which are automatically detected and downloaded). The Linux kernel detects and automatically activates hardware very well. The rare occasions where drivers need to be manually installed is when a proprietary (closed source) driver like nVidia, or Broadcom wireless NICs are needed. In Windows, drivers usually need to be manually installed right from the start. Migrations from Linux to Windows are possible, you simply need a little time, patience, and a will to learn something new.
![]()
snapple00
September 03, 2010 at 1:45pm
So you don't need to use the command line in Linux hardly ever, but you ask why use Windows when [the command line] is lacking when you could simply use Linux (where you don't need the command line because it has become so Windows-like)?
Your whole comment is how much like Windows Linux is now, and how it almost works as good when dealing with drivers etc. So... what is your point again?
![]()
captrespect
September 03, 2010 at 8:00am
You can also just add the cygwin/bin directory to the windows path. Most of the programs in cygwin are just windows exes so they can be run without launch the special console.
![]()
Bigfoot
September 02, 2010 at 9:27pm
If you really want to try Linux you need to checkout this version:
Puppy Linux
www.puppylinux.org
![]()
mothwingdust
September 02, 2010 at 7:37pm
the article was well-written and i think Cygwin would be useful for learning command-line stuff. however, for a first-time Linux user, i think it's overly complicated...which is probably the main reason more people don't use Linux in the first place. Linux has gotten so much easier to use over the past few years, especially compared to, say, ten years ago.
i'd still recommend people check out Ubuntu's Windows Install. it installs (and uninstalls) from within Windows, with all the functionality of a regular Linux install (as opposed to a LiveCD which is limited because of not being able to save or install drivers.) Windows sees it as just another program, but it lets the user do everything any other Linux install would allow. this way they can get familiar with it and install programs and drivers and do regular work, and decide whether they even want to continue using Linux. then they can also decide if they want to do a "real" linux install on a partition or seperate drive/computer, or if they want to use a different distro. and if they don't get along with Linux, they can just uninstall it like any other Windows program.
when Lucid Lynx came out, i ran it within Windows for a couple months and then decided to run a dual-boot system. i just uninstalled it from within Windows, and went through the Ubuntu setup to repartition my drive. i have only logged into Windows about five times in the past several months, and haven't looked back. i've quit using Photoshop since i'm getting used to GIMP, i've used OpenOffice for years anyway, and Rhythmbox works just like iTunes (and recognizes my iTunes music folder in my Win partition. i pointed Rhythmbox to my Win iTunes folder as my main music folder, so now i just mount that partition in Ubuntu and Rhythmbox populates with all my music and album covers.)
honestly, if it weren't for Cubase, SoundForge and all my VST plugins and instruments, i'd use Linux all the time. but if i'd started with Cygwin, i don't know that i would've bothered switching over to Linux at all. don't get me wrong, i can rock the command line action, but most of the time i just want to get on my computer and work or play.
![]()
Ashton2091
September 02, 2010 at 8:58pm
Very well said. i started dabbling in linux the exact same way you just described. it was and is a great experience. not super familiar with the command line, but i'm still learning. to get much time to spend with ubuntu since i mostly depend on windows for my music.
also, love cubase. been using it since cubase 3sx. good stuff
![]()
yaomiao
September 05, 2010 at 8:42pm
Classic exposition, I have also mentioned it in my blog article. But it is a pity that almost no friend discussed it with me.I am very happy to see your article.cheap nike air max
![]()
jac_goudsmit
September 02, 2010 at 7:23pm
Nice write-up! But I the Unix-style command to delete a file is rm, not del.
By the way, I believe the GnuWin32 programs also deserve a mention: they let you use common tools like sed and awk on a Windows command line without the need for the cygwin shell.
![]()
david.rangel93
September 02, 2010 at 6:22pm
Alex, keep up the goos work, the good quality of articles, you have truly brought back Maximum PC, i have been reading Maximum PC magazines and checking the website every day but today i was mind-blown with this great article of yours, keep them coming :D
![]()
Danthrax66
September 02, 2010 at 6:03pm
If you need to run linux get a Linux box, end of story there are a lot of things that you will run into while trying to use linux that you wouldn't normally encounter in windows. Such as configuring a brand new mp3 player to sync with amarok or getting a driver to install (which often times involves reading through logs to determine what packages need to be installed). I mean sure this tool might be useful but you won;t learn linux unless you put yourself in front of a box and use it as your main pc for a while.
Log in to MaximumPC directly or log in using Facebook
Forgot your username or password?
Click here for help.















