How to Run the Bash Command Line in Windows 10
Windows 10 may not be a Linux-based operating system, but that does not mean you cannot use your favorite Linux command-line tools. In fact, the latest version of Windows 10 includes a feature that allows you to run the Bash command-line interface, which is used on most Linux distributions. In this article, we will show you how to run the Bash command-line in Windows 10.
Step 1: Enable the Linux Subsystem on Windows
Before you can run the Bash command-line in Windows 10, you need to enable the Linux subsystem. To do this, follow these steps:
1. Open Settings from your Windows start menu.
2. Click on “Apps.”
3. Click on “Apps & features.”
4. Click on “Programs and Features.”
5. Click on “Turn Windows features on or off.”
6. Scroll down to “Windows Subsystem for Linux,” and enable it.
7. Click on “OK.”
When you enable the Linux subsystem, Windows will install a full Ubuntu Linux distribution on your computer, so be sure to have enough disk space.
Step 2: Install Bash in Windows 10
Once you have enabled the Linux subsystem, you will need to install Bash. To do this, follow these steps:
1. Open the Microsoft Store app from your Windows start menu.
2. Search for “Ubuntu” in the search bar.
3. Click on “Ubuntu” to open the page.
4. Click on “Get” to install Ubuntu.
5. Wait for the installation to complete.
Step 3: Access Bash from Windows 10
Once you have installed Ubuntu on your Windows 10 machine, you can access the Bash shell by opening the Start menu and searching for “Ubuntu.” Click on the Ubuntu app to launch the Bash command-line interface.
When you first launch Bash, you will be asked to create a new user account. You will need to enter a username and password. This account will be used whenever you run Bash, and it will not be associated with your Windows user account.
Step 4: Install additional tools in Bash
Ubuntu on Windows 10 comes with many command-line tools pre-installed. However, if you need additional tools, you can install them using the apt-get package manager. To do this, follow these steps:
1. Launch Bash on your Windows 10 machine.
2. Type “sudo apt-get update” to update the apt-get package manager.
3. Type “sudo apt-get install” followed by the name of the package you want to install.
4. Wait for the installation to complete.
Conclusion
Running the Bash command-line interface on Windows 10 is straightforward and easy, thanks to the Linux subsystem support added. By following the steps above, you will be able to install and access Bash on your Windows 10 machine in no time. This means you can use all your favorite Linux command-line tools and scripts without needing to switch to a Linux operating system.