Skip to content

How to Use Bash Shell on Windows 10

In the Windows 10 Anniversary update, Microsoft has added a big new feature to its Windows 10 operating system. Microsoft and Canonical collaboration has helped us to get a Windows operating system which is capable of running the Bash shell. It is just a toolset but not a complete Linux system or a virtual machine or Cygwin software. Windows based bash shell is based on one of the Microsoft’s project Astoria which was used for running Android apps on Windows operating system.

This new feature has the same environment as in Linux and can be used to run Linux commands directly on Windows. You can also run bash shell scripts which depend on the Linux command line utilities. All the command line utilities are similar to the native Linux environment. So, you can also access the Windows file system from the bash shell. Since it is still a beta version, you can get all the things to work out well at this stage. There are few limitations out here. The bash shell won’t work with graphic software and servers as well. Also, note that you cannot launch the Bash commands via Windows command line or vice versa. Let’s see how to run the bash shell on Windows 10.

Enable Bash Shell on Windows 10

Sorry Windows 10 32bit users you are out of the league. You need 64 bit Windows 10 operating system to use bash shell. If you are on the 64bit operating system, then follow the below steps to enable the bash shell.

  1. Click on the Start button on the bottom left corner of the screen or press the Windows key to open the Start menu.
  2. Select the Settings option in the Start menu. The settings window will appear on the screen.Start
  3. Click on the Update & Security icon in the Settings window. Click on For developers in the left side pane and select the Developer mode by clicking on the radio button near to it.
  4. A confirmation window will open on the screen. Click on the Yes button to enable the developer mode.Update_and_security
  5. Now, open Control panel > Programs and Features and click on the Turn Windows features on or off.Programs_and_features
  6. Tick the check box to enable the Windows Subsystem for Linux (Beta) option from the list of Window features. and click on OK button.
  7. Click on the Restart now button to restart the PC. Once your PC restarted, click on the Start button, type bash and hit the enter key.

If you are running the bash.exe file for the first time, then you will be prompted to accept the terms of service. Once it is accepted “Bash on Ubuntu on Windows” application will be automatically downloaded.

How to Use Bash Shell on Windows 10

Now you have successfully enabled the bash shell on your Windows 10 PC. As said above this feature has utilities similar to that of Linux environment. So you most of the Linux commands will work here and you can also access all the command in line software. Let’s see how to use the bash shell in Windows 10.

  1. Click on the Start button, type bash and hit the enter key.
  2. By default, you will be given a root shell and will have administrator permissions on the Windows. You can now use the Linux commands and start using the bash shell.
  3. Here are some of the apt-get commands to install and to do some updates to the Ubuntu environment.
    • sudo apt-get update: To downloads the package lists from the repositories and display the updated information.
    • sudo apt-get install packagename: To install an application package.
    • sudo apt-get remove packagename: To uninstall an application package.
    • sudo apt-cache search word: To search for available application packages with given word.
    • sudo apt-get upgrade: To upgrade installed application packages to the latest versions.
  4. Once you have successfully installed an application package, you can launch it by entering the package name and hit the enter key.

That’s it.

If you find this tutorial useful, do share it with your friends. Let us know your suggestions in the below comments section.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.