Microsoft recently joined hands with Canonical (the parent company of Ubuntu) to bring the entire userland into Windows, minus the Linux Kernel. So as a result, you, as a developer, get access to the whole range of Ubuntu command-line tools and utilities with bash shell integrated with Windows. Let’s look at how we can install Bash on Windows 10 and take full advantage of the new feature.
This might look like a small and helpful change by Microsoft, but contrary to that its a huge leap and making Windows-friendly for the open-source community. Needless to say, with the ability to install bash on windows, it would certainly save a lot of manhours and effort, making the life of people working on open source on Windows much easier.
Bash is the shell, or command language interpreter, which is used by various flavors of Linux and the GNU operating system. It is the interface to the operating system. If you have used Ubuntu and passed specific commands to the operating system using the terminal, the chances are relatively high that you have used Bash to do so. The name “Bash” is an abbreviation for the ‘Bourne-Again SHell’, a pun on Stephen Bourne, the author of the direct ancestor of the current Unix shell ‘sh.’ The Bash offers functional improvements over sh for both interactive and programming use.
Bash is a free version of the Bourne Shell and distributed with several Linux and GNU operating systems, including Ubuntu. Bash is the most popular command-line interpreter, especially Linux, and hence is the default interactive shell on various distributions of Linux. With the release of Windows its now possible to install bash shell on windows as well.
Windows operating system already has PowerShell, which is a command shell and scripting language, which enables the system administrators to perform various administration tasks. The PowerShell was developed on top of the .NET framework to overcome the shortcomings of the command prompt. Command prompt was a primitive tool that did not have remote administration capabilities. Remote administration and server management is the need of the hour for the development and management of the servers by the administrator.
So the question is if the PowerShell already existed in Windows, what was the need for tp install Bash shell on windows? The answer is the open-source development community. Both PowerShell and Bash differ in focus and design. Since there has been an extravagant and expansive increase in the open-source programming languages, and the developer community adopting them, it becomes essential for an operating system to support it.
Having the Bash shell integrated within the windows operating system removes the extra steps that the developers have to follow to use the same programming languages on Windows. When compared to an operating system that already has native support for the Bash, using windows powershell means a steep learning curve and extra effort.
While developing using open source programming languages and using various packages developed by other programmers, there are instances when you would need to pass multiple commands using the terminal to perform desired actions.
Before the Bash shell became a part of Windows and it became possible to install bash on windows 10, developers used to resort to various methods to use Linux commands on Windows. Here are a few other ways developers used to adopt.
An important thing to note over here is that when you install bash on Windows, the installation is native. It is not a virtual machine or an emulator. It is a complete Linux system integrated into Windows kernel. Microsoft joined hands with Canonical (the parent company of Ubuntu) to bring the entire userland into Windows, minus the Linux Kernel.
So as a result, you, as a developer, get access to the whole range of Ubuntu command-line tools and utilities with bash shell integrated with Windows. The benefit over here is obvious, and that is that a developer gets “native” Linux capabilities within Windows. Now the developers do not have to make compromises which they otherwise would while using a Virtual Machine or Cygwin.
1. From Windows desktop Open Settings.
2. Click on Update and Security.
3. Under “Use developer features,” select the Developer mode option to set up the environment to install Bash. On the message box, click Yes to turn on developer mode.
4. After installing the necessary components, you’ll need to restart your computer.
5. Once your computer reboots, open Control Panel and click on Programs.
6. Click on Turn Windows features on or off.
7. Check the Windows Subsystem for Linux (beta) option and click OK.
8. After installing the components on your computer, click the Restart now button to complete the task.
9. Once your machine has restarted, you would need to install the Ubuntu distribution for Windows Subsystem for Linux. To do that use the following command in the command prompt.
10. Once installed, you would need to set up your Unix username and password, which can be different from your Windows account username and password. Once done, you are good to go with using Bash on Windows. Whenever you want to run a bash command in windows now all you would need to do is open the command prompt in Windows and use the following command. That’s it!
Previously published at https://cloudaffle.com/install-bash-on-windows/