Home » Linux » Shell » Bash For Windows

How to Install & Use Bash (Linux Shell) on Windows 10 [Tutorial]

Here’s how to set up and use the Linux shell on Windows – using the Windows Subsystem for Linux (WSL).

This tutorial is intended for up-to-date versions of Windows 10 from 2020 onwards. I’m not going to cover how to use WSL on older versions of Windows 10 or other methods for Windows 8/7/XP/3.1 because you shouldn’t be using outdated software. If you must use Windows, use a version that still receives security patches!

WSL is a great tool and allows you to pretty much run Linux software on windows as if you had never left Linux. Not everyone has the luxury of being able to install a Linux system due to relying on proprietary software released only for Windows.

Anyway, here’s how to get a Linux shell happening on Windows 10, courtesy of the Windows Subsystem for Linux.

Install Windows Subsystem for Linux

First, you will need to install support for the Windows Subsystem for Linux in Windows 10.bash windows 7

This is done from the Settings app – so open it up and then click on Apps.

bash windows 8

Then click on Programs and Features in the sidebar to the right.

bash windows 9

Next, click Turn Windows features on or off in the sidebar to the left.

bash windows 11

Scroll down the list and check Windows Subsystem for Linux, then press OK

Confirm your selection, then allow your computer to restart to complete the installation.

Install Ubuntu From The Windows Store

First, make sure that your copy of Windows 10 is completely up-to-date. Older releases of Windows 10 from before 2020 do not support the Windows Subsystem for Linux.bash windows 2

Next, open the Microsoft Store from the Start Menu, or search for ‘store.’

bash windows 3

Search for ‘Ubuntu’ from Canonical.

To install it, click ‘Get’ and wait for it to download.

This “App” contains a full copy of Ubuntu for the Windows Subsystem for Linux – including the Bash shell, and a full Ubuntu command line environment.

bash windows 4

Launch the downloaded Ubuntu App by clicking ‘Launch.’

bash windows 5

A shortcut to Ubuntu will also be added to your start menu.

bash windows 12 1

When you launch Ubuntu, you’ll be dropped right into a Linux Bash environment in Windows – cool!

Install the Windows Terminal (Optional)

The terminal which Ubuntu opens is a bit lacking, however. There’s a better Terminal App now available – The Windows Terminal!

Windows Terminal supports things like tabs and custom configurations. You can have a Powershell tab open next to a Bash Terminal; it’s really nice.

It’s in the Windows Store, so search for it and install it.

bash windows 14 1bash windows 15 1

Conclusion

Windows is still the industry standard for many fields – including graphic design and CAD. Some software development tools are also only supported on Windows.

If you rely on software that can only be run on Windows, running and testing Linux software without having to rely on a cumbersome virtual machine saves both time and resources.

SHARE:
Photo of author
Author
I'm Brad, and I'm nearing 20 years of experience with Linux. I've worked in just about every IT role there is before taking the leap into software development. Currently, I'm building desktop and web-based solutions with NodeJS and PHP hosted on Linux infrastructure. Visit my blog or find me on Twitter to see what I'm up to.

Leave a Comment