Interoperability Gow Lead image: © Markus Gann, 123RF.com
© Markus Gann, 123RF.com
 

GNU tools under Windows

In Harmony

Many admins are responsible for heterogeneous IT environments. Those who want use the popular Bash and GNU tools under Windows can either install the Cygwin compatibility layer or try Gow, the more slender alternative. By Thomas Drilling

Many administrators consider Bash and the GNU tools to be indispensable standard utilities for routine administrative tasks. For more than 20 years, the Bash Unix/Linux command shell, developed in 1987 by Brian Fox, has indisputably been one of the most powerful and popular tools for gaining access to the system level of Unix-based operating systems. Bash's popularity is not just a function of its built-in commands. The ability to work with shell scripts is an elegant way to consolidate repetitive commands or to write programs that complete complex and intelligent tasks.

Besides these "internal" commands, Bash also includes control structures that make it possible to call up useful GNU tools, which usually make up the largest part of complex Bash scripts. Therefore, the ability to use Bash and GNU tools to control Windows machines is interesting for several reasons. For one, its internal commands and control structures make Bash much more powerful than a simple Windows "command prompt," even for simple filesystem operations. Only PowerShell is slowly starting to bring a tool with similar potential to the Windows world.

GNU Under Windows

Tools like Gow (Gnu on Windows) bring a multitude of powerful GNU tools to Windows – among them, classics for text editing, powerful filesystem utilities, and the most important SSH tools. Incidentally, Gow also makes it possible for users who are considering switching to Linux to get accustomed to the Unix directory structure and the Bash command line without having to install an emulator or a virtual machine.

Gow Instead of Cygwin

Developed by Brent Matzelle, Gow [1] was conceived as a compact alternative to Cygwin. Gow, which is hosted on GitHub, is free software provided under the MIT license. Cygwin, on the other hand, is a compatibility layer that makes substantial Linux API commands available under Windows. Those who are not already familiar with Cygwin will find a useful summary in the "Alternatives" sidebar. Like Cygwin, Gow also brings 138 Unix tools to the Windows desktop, but at a little less than 10MB, it is much more compact than Cygwin's 100MB and is also easier to install.

Besides the shell/shell-scripting functions (Bash and Zsh), Gow also makes GNU tools available for text editing (grep, agrep, less, cat, tail, head), file management (mv, cp, du, ls, pwd, rmdir, whereis), downloading and uploading (curl, wget, ncftp), SSH (putty, psftp, pscp, pageant, plink), compression (gzip, zip, bzip2, compress), and development (make, diff, diff3, sleep, cvs, dos2unix, unix2dos, as well as the popular and powerful Vim editor. For installation, admins only have to download the 6MB installation file of the current version 0.5.0 [2], double-click on it, and accept the licensing conditions (Figure 1).

Unix under Windows in an instant: Gow is just as easy to install as any other Windows tool.
Figure 1: Unix under Windows in an instant: Gow is just as easy to install as any other Windows tool.

Minimal or Optimal

In the following step in the installation wizard, admins can choose between a default or minimal installation. The latter only includes the core components.

After choosing the installation directory in the next step, the wizard puts all the necessary binary files onto the hard disk and modifies the Windows path correspondingly so that all tools can be reached over the standard command line.

This is also true for the Linux shell (Bash), which can be started simply by entering bash in the Windows CMD shell. This step will only work after restarting the Windows machine, however, and is executed directly in the CMD window with the totally unspectacular result that the prompt changes its appearance.

When first starting out, you'll need to create a temporary directory with mkdir /tmp, which is already done with the mkdir Unix command. At this point, most of the Bash commands mentioned above are available for use. An overview of all the other Unix commands available can be called up with

gow.bat -l

(Figure 2).

Gow makes it possible to use these Unix tools and commands.
Figure 2: Gow makes it possible to use these Unix tools and commands.

All Unix tools that have been ported for Gow are found in the bin subdirectory of the path created during installation. Tools that include a user interface, like putty or ncp, can be started by double-clicking.

Conclusions

Like Cygwin, Gow makes it possible to use Bash tools as well as many GNU utilities under Windows. In comparison, however, Gow is much more compact, is easy to install, and is also actively maintained, providing updates for the included programs. Apart from Make, however, developer tools like the GNU compiler are missing, for which users will still have to resort to Cygwin.