Table of Content

For scripting, we would like to have own dev and test environment. If you prefer do everything from command line and hate MS famous DOS terminal like me, this is solution for you – lightweight *NIX shell on windows.

Let’s go.

1) setup *NIX like environment – msys + MinGW

MSYS is a collection of GNU utilities such as bash, make, gawk and grep to allow building of applications and programs which depend on traditionally UNIX tools to be present. It is intended to supplement MinGW and the deficiencies of the cmd shell.

MinGW ("Minimalistic GNU for Windows") is a collection of freely available and freely distributable Windows specific header files and import libraries combined with GNU toolsets that allow one to produce native Windows programs that do not rely on any 3rd-party C runtime DLLs.

Simply word, msys + MinGW provides you a very light *NIX like shell environment, you run basic unix command and run shell script.

I installed them under C:\PortableApps, msys 40MB, MinGW 60MB, totally portable after once installation.

2) make *NIX like terminal/console – console2

console2 is a Windows console window enhancement. Console features include: multiple tabs, text editor-like text selection, different background types, alpha and color-key transparency, configurable font, different window styles.

The feature I most like is tab configuration, you can pre-setup shell for tab, for example I created msys tab:

shell: C:\PortableApps\msys\bin\bash.exe --login -i
Startup dir: C:\PortableApps\msys\bin

also can add more tab, for example cygwin tab:

shell: C:\PortableApps\cygwinPortable\App\Cygwin\bin\bash.exe --login -i
ipython tab:
shell: C:\Python26\python.exe Scripts\ipython.py

3) build-in tool

msys: there are 180+ unix command

Most used:  bash, vi, ssh, perl, awk, ftp/sftp, head/tail, ls, cat, less, gzip/gunzip, tar, grep/egrep, sed, dh, df, ps

MinGW: gcc. g++

4) application

If you don’t like to use tools in msys+MinGW, just need a lightweight *NIX shell, you can install any tools window and setup path for it.

Let’s give example for python.

Install python binary to C:\Python26, then setup path in /etc/profile:

export PATH=/c/Python26:$PATH

or mount in /etc/fstab:

C:/Python26 /python

This is not real UNIX but it is enough for most of scripting task from command line.