Improve your Windows Command Line

August 10, 2013

 - Tags:

Developers often complain that compared to the CLI of UNIX operating system, Windows CLI really sucks. It’s because Windows CLI lacks a lot of useful commands provided in UNIX CLI tools. In this article, I’ll show you how you can change that.

Step #1: install Console2

First, let’s install Console2, a better console for Windows. To install and launch Console2:

  1. Follow this link and download the zip folder.
  2. Unzip it wherever you want
  3. click on the .exe file inside.

That’s it, you have just installed and launched console2.

Advantages of Console2 over Windows CLI:
Tabs & Easy Copy Paste

It may not seem like Console2 have a lot of advantages over the Windows CLI, but believe me it does have. For example, if you start a server with the Windows CLI, you can’t use the current CLI window for other commands anymore. You would need to open another CLI window. Then, you may want to use the MySQL CLI, which will lead to the same problem: now you have two windows that you can’t use for other commands. You would then need to open a third window to execute other commands. With console2, you can take advantage of the tabs and open as many CLI instances as you want, without bloating your screen.

Then for the Copy Paste feature, to be fair I have to admit that the Windows CLI also has it. But it’s not as easy as it is on Console2, where there are copy and paste buttons directly on the top menu. You can also create your custom shortcuts, but so far I haven’t managed to get it to work.

Step #2: install Unxutils

Ok, now we have a better Command Line tool, but we still haven’t tackled the main problem: we still miss all these UNIX-specifix commands (grep I am thinking about you).

To solve this problem we will use a library called Unxutils. It is quite old, but it still does the job perfectly.

  1. Go to this website, download UnxUtils.zip and unzip it in your C:\ root folder.
  2. Add C:\unxutils\usr\local\wbin to yourPATH environment variable. This will tell Windows where to find the libraries when you will use your new UNIX-specific commands.

If you have never set any PATH environment variables before, don’t panic it’s quite easy. Just follow these instructions here

Conclusion

In this article, we learned how to improve the Windows CLI, in order to catch up with the features of CLI found in UNIX-like OS.

In Step #1, we installed console2, a better CLI for windows, with tabs navigation and easy Copy & Paste feature.

In Step #2, we installed Unxutils, a library to enrich our CLI with commands traditionally only found in UNIX-like OS (like grep or awk)

If you liked the article, you can subscribe to my blog to receive updates when new articles are posted.

If you would like to know more about Windows CLI, please check out the below resources.

Additional Resources

  • Another article about console2: Link
  • The official website of Console2: Link
  • The official website of Unxutils: Link
  • gnuwin32, a more powerful and more modern alternative to Unxutils. However the installation is more difficult. Here is the Link
  • Cygwin, a much more powerful alternative to Unxutils. Installing it can be quite difficult as well, and using it can feel a bit clunky. If you want to try it yourself, go to: Link

Leave a Reply