With the release of the Windows 10 Anniversary update, which was built largely on feedback from users who were part of the Insider Preview Program for Microsoft’s newest OS, we wanted to highlight one feature of Windows 10 that we’ve found to be particularly useful. The Windows 10 Build 14393 enabled users to run a native Bash shell on Ubuntu on Windows 10. As Microsoft said when announcing this feature:
You can now run Bash scripts, Linux command-line tools like sed, awk, grep, and you can even try Linux-first tools like Ruby, Git, Python, etc. directly on Windows. You can also access your Windows filesystem from within Bash allowing you to work on the same set of files using your preferred Windows tools or Linux command-line tools.
Enabling Bash isn’t difficult, but it’s also not strictly intuitive. Here’s what you need to do.
Enabling Bash in Windows 10
First, make sure you’re turned on Developer Mode by going to Settings > Update & Security > For Developers.
Next you’ll need to turn on the Windows Subsystem for Linux by navigating to Control Panel > Programs > Programs and Features and clicking on the link in the left column that says “Turn Windows Features on or off“. Then simply select the box next to Windows Subsystem for Linux (Beta) and hit OK.
Installing Bash in Windows 10
To install Bash first open the command prompt. You can get to the command prompt any number of ways but in the image below we simply pressed the Windows Key + X. Then click on Command Prompt or Command Prompt (Admin) if the options is available.
Once you’ve opened the command prompt, simply type bash and then y and wait for the Ubuntu subsystem to be downloaded and installed.
Once the install is complete you’ll be placed in the Bash environment and you’re off and running with the Linux command-line tools and Bash scripts you know and love.
NOTE: Depending on your settings and system, you may be asked to create a UNIX user account before installation is completed. As the prompts will indicate, your UNIX username does not need to match your Windows account. Simply follow the prompts to create a username and wait for the installation process to finish.