How to use Bash Shell in Windows 10

In the Windows 10 Anniversary Update, Microsoft added a great new feature to its Windows 10 operating system. Collaboration from Microsoft and Canonical helped us get a Windows operating system capable of running the Bash shell. It’s just a set of tools, but not a complete Linux system or a virtual machine or Cygwin software. Windows based bash shell is based on one of Microsoft Astoria projects which was used to run Android apps on Windows OS.

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

Enable Bash Shell in Windows 10

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

  1. click on the To start button in the lower left corner of the screen or press the Windows key to open the Start menu.
  2. Select the Definitions option in the Start menu. The settings window will appear on the screen.
  3. click on the Update and security icon in the Settings window. click in for developers in the left side panel and select the developer mode clicking the radio button next to it.
  4. A confirmation window will open on the screen. click on the Yes button to activate developer mode.Update_and_security
  5. now open Control Panel > Programs and Features and click on Turns window features on or off.Programs and features
  6. Check the checkbox to enable the Windows Subsystem for Linux (Beta) Windows feature list option. and click OK button.
  7. click on the Restart now button to restart the PC. Once your PC has restarted, click the Start button, type revelry and hit the enter key.

If you are running bash.exe for the first time, you will be asked to accept the terms of service. once accepted”Bash on Ubuntu on Windows” will be downloaded automatically.

How to use Bash Shell in Windows 10

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

  1. click on the To start button type revelry and hit the enter key.
  2. By default, you will be given a root shell and given administrator permissions on Windows. You can now use Linux commands and start using the bash shell.
  3. Here are some of the apt-get commands to install and do some updates in Ubuntu environment.
    • sudo apt-get update: To download package lists from repositories and display 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 app packages with a given word.
    • sudo apt-get upgrade: To update installed application packages to the latest versions.
  4. After successfully installing an application package, you can launch it by typing the package name and pressing the Enter key.

That’s it.

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

Leave a Comment