Computers, anime, and writing – A confederation of topics
“Wait a minute, what? What is Cygwin? Never ‘eard of it.”
“Not to worry-allow me to explain…”
Cygwin-exactly what Cygwin does is best described on the homepage, cygwin.com, in which the following is said:
a DLL (cygwin1.dll) which acts as a Linux API layer providing substantial Linux API functionality.
The other explanation is, in my opinion, incorrect so I will not bother plagiarizing it. Anyways, moving on.
For those of who found that explanation clear as mud, let me explain further: Cygwin is a terminal that can be installed on Windows systems to provide a Linux-like environment for running programs and doing certain actions in. Cygwin is NOT…
- a way to run native Linux apps on Windows. You must rebuild your application from source if you want it to run on Windows.
- a way to magically make native Windows apps aware of UNIX® functionality like signals, ptys, etc. Again, you need to build your appsfrom source if you want to take advantage of Cygwin functionality.
So basically, Cygwin is a program that allows you to use the Linux terminal on a Windows machine, plain and simple.
“Why would I want to do that?”
“There are some awesome things that you can do with the Linux command line-“
In my post Installing and running Linux, posted in January of this year, I went over some basic commands that can be used in the Linux terminal. Here’s a quick recap of the commands mentioned in my article, as well as a couple extra commands:
- cd. cd allows you to change your current working directory in the terminal by passing the value of the directory you would like to move to as a parameter to cd. For example, cd home would change my current directory, if there was a folder in my current directory that matched “home”, to that directory. I would then be able to use the next command to be mentioned (ls) to view the contents of the “home” directory. Here is a brief list of examples for the cd command:
— cd ..
Will move up one level in the directory tree. So if you are in C:/Users/Lin and you type cd .. and hit enter, your terminal would be moved to C:/Users .
— cd Dir2/Dir3/Dir4
It is not a rule that you can only move up or down one directory level at a time. In reality, you can move up any number of directories, so long as you have the order and the spelling correct. The command above would go from, assuming the terminal is currently in Dir1, to Dir4, which is inside the directory Dir3, which is similarly inside the directory Dir2. You can also do this with the .. “directory” and move up any number of levels at a time.
- ls. ls is a simple yet very powerful command that prints the contents of the current directory to the terminal window. ls is the simplest command to list the contents of the current directory, and will only print the names of the files and folders within the current directory to the screen.
This command seems to be only supported in Cygwin. ls –lsa prints the names of the files in the current directory to the screen, along with other detailed information about the files such as date created, permissions, and various other specifics.
—ll (el el)
This command basically does what ls –lsa does, except it works in all (so far as I have tried) distros of Linux, but not Cygwin.
- rm. rm is deceptively simple and wickedly affective. rm stands for “remove” and, as its name suggests, removes things. The syntax for deleting something with rm is as follows: rm file.txt, where “file.txt” is the name of the file to be removed. If you were to use the rm command on a folder that contained files however, you would receive an error. Conversely, if the folder was empty no error would be raised and the folder would be deleted. The way to get around this with rm is to use rm –r.
—rm –r means to recursively delete the files in the directory specified. Beware that once something is deleted through the use of rm–or any other command line deletion tool-that file, or directory, is gone forever.
- mkdir. Now that you know how to delete a a directory, what about creating them? That’s where mkdir comes in. mkdir means “make directory”, and will make a directory within the current directory with the name passed in to the command.
These three commands are the basics you will need to know in order to preform simple tasks in the command line. There are thousands more commands for doing pretty much everything, but that is not within the scope of this post and therefor will not be discussed here.
“Sounds pretty neat; so how do I get it?”
Follow these easy steps:
- Go to the Cygwin download page at cygwin.com/install
- Download setup.exe – the Cygwin installer.
- Once the installer finishes downloading, begin the installation by running it.
- Follow the prompts until you are presented with a window containing three radio buttons. Make sure that the top radio button, “Install from Internet”, is checked. Click the “Next” button.
- Unless you want Cygwin installed for every user on your computer, click the radio button with the label “Just Me”. Click “Next”.
- In the “Select Local Package Directory” window, simply click the “Next” button and do not worry about the “Package Directory” field.
- Click “Next” in the “Select Your Internet Connection” window, leaving the radio button with the label “Direct Connection” checked.
- In the “Download Site” window, pick a site that ends in .edu, as this is, in my opinion, a better server to download from versus some of the other options. Once you have picked a download site, click “Next”. The files for your Cygwin installation will begin downloading. The download could take quite some time, depending on your internet connection, so feel free to go do something else for a while.
- In the “Select Packages” window that will appear once the package files are downloaded, click the picture of two arrows in a circle between “All” and “Default”. Each time you click the icon, the text to the right will change. Click the icon once so that it now reads “Install”. This will install everything you need for Cygwin. Click “Next”.
- When the installation is finished, you may choose to create icons on the Desktop and/or in the Start Menu. Make your choices and click “Finish” or “Next”, whichever is available, and finish the installation process.
- Congratulations, you have now successfully downloaded and installed Cygwin. To use Cygwin, either open it with the Desktop icon, or go to your Start Menu, click All Programs, and look for the folder named “Cygwin”. Within the “Cygwin” folder will be an icon labeled “Cygwin Bash Shell”. Alternately, you can open RXVT (rxvt), which will give you the same environment as the Cygwin Bash Shell with a few improvements: the ability to resize the window, and the ability to copy-and-paste (using the middle-button on the mouse to past it).