Bash for Windows has been live for some time, and packs a wallop of capabilities. While certainly catering to a developer audience, more features lurk beneath the command lineWindows 10 Receives a Full Linux Command PromptWindows 10 Receives a Full Linux Command PromptBASH shell, complete with a Linux sub-system, is coming to Windows 10 with the Anniversary Update this summer. That was one of the biggest announcements at the Build Developer Conference. Here's why this matters.Read More. Learn more about Bash on Windows, from how and why you should install it, to hidden features you probably didn’t know about.

System Requirements for Bash on Windows

Getting Bash on Windows installed is pretty simple, but let’s start with the basics.

So installing and running Bash on Windows is surprisingly easy. As long as you’re armed with a 64-bit Windows 10 PC and have the Anniversary Update installed, it’s as simple as switching on a few features.

Enabling Bash on Windows

Enabling Bash on Windows isn’t as difficult as it sounds. Here’s how to go about with install.

What You Can Actually Do

…should work perfectly. Installing packages and updates using apt and apt-get functions great as well. Symlink and file system support comes via the Windows Subsystem for Linux (WSL) environment, and there’s some programming language support for the likes of Python, NodeJS, and Perl. While Bash on Windows is not intended for running graphical apps, it can be accomplished.

Luckily, you can’t edit/open/delete Windows apps or alter Windows system settings. This is a great failsafe, as we all know mistakes can happen when using the command line.

Installing Linux Software

On Linux, you can install apps via several methods. The command line is most commonly used. The apt-get downloads software packages from repositories, along with dependencies. It’s nifty, and would look like this (sans-brackets, and with the actual package name):

Pretty simple. However, make sure to include sudo as we need superuser permissions. Git, and other software may be installed from source as well.

Born to Run (Graphical Apps)

Bash on Windows does not support graphical Linux apps, or at least officially. However, community members found a method of doing so using the apparently rather versatile Windows Subsystem for Linux. Just because something isn’t made for one purpose doesn’t mean it can’t be used for that.

Case in point: installing Bash for Windows installs an entire Ubuntu user space image. Basically, you get everything (all the binaries) that is featured on a traditional Ubuntu install with a graphical user interface (GUI).

By including a complete Ubuntu user space, it’s therefore possible to run graphical Linux apps on Windows. The workaround calls for installing X Server, using apt-get to install a program, setting a display environment variable, and finally launching the application. Though not particularly difficult, it is a cumbersome process as display environment variables must be set each time you want to run a graphical app.

Furthermore, it’s an unsupported feature, so functionality is contingent on a bevy of factors. As any native Linux user knows, app installs often require dependencies and tweaks as is, so you can only imagine jerry-rigging Bash on Windows to run these.

Accessing Files

Installing Bash for Windows creates a full Ubuntu user space. You can easily access these files using the Windows File Explorer. However, you will have to know where to look, which requires first enabling Show hidden files, folders, and drives under File Explorer view options. Each Windows user account has its own Ubuntu user space, which can be found by navigating to the folder:

C:\Users\USERNAME\AppData\Local\Lxss\rootfs

The account home folder resides at:

C:\Users\USERNAME\AppData\Local\Lxss\home\USERNAME

With the root folder of:

C:\Users\USERNAME\AppData\Local\Lxss\root

Accessing Windows system files in Bash is a bit different. The default in Bash is the Ubuntu root directory created within the Windows file system. But you may mount the Windows system drive. So to mount the C: drive, use the command:

/mnt/C

For the D: drive this would be:

/mnt/D

And so on. Since we’re using the command line, we can couple such commands with the likes of cd (change directory). Permissions work a bit differently. To access the admin folder, the Bash on Windows program requires the “Run as Administrator” privilege.

Server Management

Want a super practical reason to use Bash for Windows? Server management is a great idea. Creating a server is really easy, but if it’s headless, you’ll need a way to manage it. There are loads of apps including PuTTY, but the command line offers a simple solution. Just ssh into the server and you can manage it from the terminal. Running remote scripts works quite well using Bash on Windows, and it’s a fantastic useful application.

Uninstall Bash for Windows

Once you’ve installed Bash for Windows, it’s fairly easy to uninstall. There are two main methods for accomplishing this: one removes Ubuntu environment but keeps your home folder intact. To accomplish this, run these commands via the command prompt or PowerShell:

lxrun /uninstall

A notification will then warn of the results of uninstalling: “This will remove the Ubuntu environment as well as any modifications and new applications…”

Type y to proceed with removal.

The alternative turns off the Windows Subsystem for Linux and this removes the Ubuntu environment and the home folder:

lxrun /uninstall /full

A notification warns:

“This will uninstall Ubuntu on Windows. This will remove the Ubuntu environment as well as any modifications, new applications, and user data.”

Type y to allow the removal of the software.

Bash on Windows packs loads of potential, and there are superb resources from the likes of the Windows blog, Ubuntu community sites, and even everyone’s favorite: Reddit. Conversations in the /r/bashonubuntuonwindows thread include running Visual Studio code, Samba file servers, and developing with WSL. As running graphical apps proved, the possibilities are almost infinite.

What are you currently using Bash on Windows for? Are you even running Bash on Windows? Let us know in the comments section below!

Moe Long is a writer and editor covering everything from tech to entertainment. He earned an English B.A. from the University of North Carolina at Chapel Hill, where he was a Robertson Scholar. In addition to MUO, he has been featured in htpcBeginner, Bubbleblabber, The Penny Hoarder, Tom's IT Pro, and Cup of Moe.