Hello Devz,

You may want to use Linux for many reasons: services, development, scripting, or just for the environment.

And you can use it in a few different ways:

  1. Install (dual boot) a distro like Ubuntu, Fedora, Mint, …
  2. Use a virtual machine with VMWare or VirtualBox
  3. Use “Bash on Ubuntu on Windows” or also called “Windows Subsystem for Linux

This post will explain the power and the many advantages of having this Subsystem for Linux deeply linked and integrated to Windows.

 

Install Bash for Windows

There are 3 different ways to do it.

1) Press the Windows button and write “windows features”, then select “Turn Windows features on and off”. Check “Windows Subsystem for Linux (beta)” then click OK:

2) Open Powershell as Administrator and run the command:

3) Open the Windows Store and search for Ubuntu (or Suse, …), then click on “Get”:

Now you can start Bash simply by opening CMD then type “bash”.

 

Basic Linux commands

You can use your new Linux just like any other Linux:

 

Access and execute Windows file

Just by typing the command “ls” and “pwd”, you will see that you are actually in your Windows Home folder for the current user. But you can go further by typing “notepad.exe”. Which means you can run any Windows application, giving you a lot of opportunities, like running advanced shell script manipulating Windows files and/or applications.

In this example, we will create a text file, then open it with Notepad:

 

Run Linux commands outside Bash

If you just want to run a Linux command from the Windows Run, simple click the Windows button and type:

For more information about the possibilities of Bash for Windows (how to upgrade the Linux environment, reinstall Bash, change Linux user, …), please read this article.

Enjoy!  🙂