So if you already installed UNIX-like software on Windows such as Apache, MySQL, PHP, Perl, and Emacs, why should you miss your favorite UNIX-like commands?
This tutorial describes how to setup UnxUtils on Windows (tested with Windows XP Professional).
Download UnxUtils from one of the following links:
Extract the downloaded .zip file into whatever folder (I created C:\unxutils\).
There are two subfolders of interest: C:\unxutils\bin\ and C:\unxutils\usr\local\wbin\
Add these paths to the PATH Environment variable:
Start -> Control Panel -> System -> Advanced -> Environment Variables
In the System variables section, select the Path variable, clic Edit, and add
at the end (no spaces).
That's all what's needed.
Now open a Command Line window (if you already had a Command Line window opened, you have to close and open it again, as the PATH changes doesn't apply to already running applications).
Run ls, pwd, cat, or any of your favorite UNIX command (limited to commands included in C:\unxutils\usr\local\wbin\, of course).
Feels like home, doesn't it? :-)
You can even run shell scripts.
Create a test script called test1.sh:
echo This is the current directory:
and run it as sh test1.sh.
Note: The which command must always add the windows extension .exe in its argument.
That is, which which will fail, while which which.exe will work.
If you haven't done so already, you may install Emacs and/or MinGW to get a more UNIX-like development environment on your Windows box.