Linux commands in Windows
I am constantly finding myself using the Windows Command Prompt and accidentally entering commands such as:
C:\Documents and Settings\Administrator>ls
'ls' is not recognized as an internal or external command,
operable program or batch file.
So I went on a quest to see if there was an easy way to use POSIX (Portable Operating System based on Unix) commands in the Windows Command Prompt.
The answer… Cygwin!!
Cygwin is about the niftiest thing since sliced bread. In a nutshell, it is a collection of a buch of common GNU posix applications ported and compiled to run on Windows. And best of all, it is a sinch to install.
Steps to install Cygwin:
- Download and run the installer
- Select Download Source

- Select Root Install Directory

- Select Local Package Directory

- Select Connection & Download Mirror
- Select Packages (Toggle the View to “Full”). Be sure to go over the list and add any extra packages you would like to download.

The installer will then download and install your selected packages.
Steps to make Cygwin commands available in the Windows Command Prompt:
- Hold ALT and Double-Click “My Computer” and select the “Advanced” tab

- Click the “Environment Variables” button
- Under the “System variables” section, double-click on the variable “Path”

- Then, simply add
;c:\cygwin\binto the end of the variable section of the pop-up. - You can then safely “Ok” out of all the open windows.
- Restart your computer. A reboot is required for the path variable changes to take effect.
Once rebooted, you can then issue your chosen linux commands in the Windows Command Prompt:
C:\Documents and Settings\Administrator>ls -la total 518 drwxrwx---+ 14 Administrators SYSTEM 0 Nov 29 23:21 . drwxrwxr-x+ 8 Administrators SYSTEM 0 Nov 27 12:29 .. dr-x------+ 6 ???????? None 0 Nov 27 16:33 Application Data drwx------+ 2 ???????? None 0 Nov 8 13:21 Cookies drwx------+ 2 ???????? None 0 Nov 29 23:38 Desktop dr-x------+ 3 ???????? None 0 Nov 27 12:29 Favorites drwx------+ 6 ???????? None 0 Nov 8 06:07 Local Settings dr-x------+ 2 ???????? None 0 Nov 27 12:29 My Documents -rwx------+ 1 ???????? None 524288 Nov 29 23:38 NTUSER.DAT
