If you're a developer working with both Linux and Windows, you can now add Bash shell on Windows 10 to run Linux commands. Here's how to install the tool.
Microsoft continues to invest on making Windows 10 the best productivity operating system, and in the Anniversary Update, the company is not only including great improvements and changes, but also adding a big feature for developers. We're talking about the Linux Bash shell, and this is a big deal.
Bash shell is simply a command-line utility that has been part of Linux for a long time, and it's often used by developers. Microsoft added it directly into Windows 10 with the Anniversary Update, and everything works thanks to the new Windows Subsystem for Linux.
Bash on Ubuntu on Windows 10 works natively — there is no emulator, virtual machine, or anything of that sort. Microsoft and Canonical (the company behind Ubuntu) collaborated to bring a version of Bash that runs in the new subsystem alongside Windows applications. But don't get confused, this isn't Linux on Windows either, it's just a tool that allows you to run the same commands as if you were using a Linux computer.
Microsoft is focusing the new tool for developers, as such Bash doesn't come installed by default. In this guide, we'll walk you through the steps to install the Bash shell command-line tool on your Windows 10 PC.
How to install Bash on Ubuntu on Windows 10
Before trying to install the Bash shell on Windows 10, there are a few prerequisites. First and foremost, you need to be running the Windows 10 Anniversary Update on your machine. If you're not, you can use our guide to get the update on your device.
The second requirement is to be running the 64-bit version of Windows 10. If you're running a 32-bit version of the operating system, you can use this guide to move to the 64-bit version.
To install Bash shell on your Windows 10 PC, do the following:
- Open Settings.
- Click on Update & security.
- Click on For Developers.
Under "Use developer features", select the Developer mode option to setup the environment to install Bash.
On the message box, click Yes to turn on developer mode.
- After the necessary components install, you'll need to restart your computer.
- Once your computer reboots, open Control Panel.
- Click on Programs.
Click on Turn Windows features on or off.
- Check the Windows Subsystem for Linux (beta) option.
- Once the components installed on your computer, click the Restart now button to complete the task.
After your computer restarts, you will notice that Bash will not appear in the "Recently added" list of apps, this is because Bash isn't actually installed yet. Now that you have setup the necessary components, use the following steps to complete the installation of Bash:
- Open Start, do a search for bash.exe, and press Enter.
On the command prompt, type y and press Enter to download and install Bash from the Windows Store.
- Then you'll need to create a default UNIX user account. This account doesn't have to be the same as your Windows account. Enter the username in the required field and press Enter (you can't use the username "admin").
- Close the "bash.exe" command prompt.
Now that you completed the installation and setup, you can open the Bash tool from the Start menu like you would with any other app.
It's important to note that unlike the real Bash shell you'll find in Linux, the version of the command line utility has some limitations with Windows.
For example, the Windows Subsystem for Linux wasn't designed to run Linux graphical applications (e.g. KDE, Gnome, etc.) on Windows 10. The tool is only to offer developers a text-based command-line feature to run Bash and core Linux tools within the operating system.
In addition, while Linux applications can access the system files and pretty much everything on your main drive, you can't launch or use scripts on Windows programs.
Finally, remember that Microsoft is releasing this feature with the "beta" label on it, which means that it's still a work in progress, not every intended feature is included, and sometimes it may not work correctly.
With the Windows 10 Anniversary Update, Microsoft is focusing on core functionalities, including:
- Bash environment to run tools like awk, sed, and grep.
- Basic features for languages, such as NodeJS / npm, Python, Perl, Git.
- Command line editor, including vi, emacs, and ssh.
- Linux user support.
- Symlink support.
- Ability to run apt and apt-get for updates and package testing.
- Ability to mount local a local hard drive using /mnt
Do you use Bash on Ubuntu on Windows 10 on your PC? Let us know in the comments below. If you do, also tell us what you use it for and your favorite commands.
More Windows 10 resources
For more help articles, coverage, and answers on Windows 10, you can visit the following resources: