Categories
Planning

How to quickly launch a bash shell from windows 10’s file explorer

Chris Hoffman is Editor-in-Chief of How-To Geek. He’s written about technology for over a decade and was a PCWorld columnist for two years. Chris has written for The New York Times and Reader’s Digest, been interviewed as a technology expert on TV stations like Miami’s NBC 6, and had his work covered by news outlets like the BBC. Since 2011, Chris has written over 2,000 articles that have been read nearly one billion times—and that’s just here at How-To Geek. Read more.

Launch Bash on Windows 10 and it will automatically open to your UNIX account’s home folder. Rather than using the cd command to change to another folder, you can launch Bash directly from a folder in File Explorer.

You can do this without any registry hacks or changes. It’s just hidden. But if you’re willing to dive into the registry, you can make it a little more convenient. Here are our two recommended methods.

Update: If you have multiple Linux environments installed, you can use the wslconfig command to choose the default Linux environment that appears when you run the bash command.

The Easy Option: Use the Address Bar

When you want to launch bash at a specific folder, just navigate to that folder in File Explorer normally. Click the address bar while in that folder, type “bash”, and press Enter.

You’ll get a Bash prompt window focused in the folder you selected.

For example, if you type “bash” directly in the root of the C: drive, Bash will open with the directory /mnt/c selected.

The Right-Click Option: Add a Context Menu Option by Editing the Registry

Perhaps you’d rather have a context menu option like the “Open command window here” option that appears when you hold Shift and right-click inside a folder in File Explorer.

To get this kind of Bash shortcut, you’ll need to edit the registry and add this feature yourself. If you’d rather not do this by hand, we have a quick .reg file you can run below instead.

Standard warning: The Registry Editor is a powerful tool and misusing it can render your system unstable or even inoperable. This is a pretty simple hack and as long as you stick to the instructions, you shouldn’t have any problems. That said, if you’ve never worked with it before, consider reading about how to use the Registry Editor before you get started. And definitely back up the Registry (and your computer!) before making changes.

First, open the registry editor by pressing the Windows key, typing “regedit” into the Start menu, and pressing “Enter”.

Navigate to the following key:

Right-click the “shell” key and select New > Key.

Name the key “bash” or something similar. You can name it anything you want. This name doesn’t appear in Windows anywhere, and is just used to keep track of the entry in the registry.

Select “bash” (or whatever you named the key) in the left pane.

Double-click “(Default)” in the right pane and enter whatever name you want to appear in File Explorer’s context menu. For example, you could enter “Open a Bash shell here” or just “Bash”.

Next, right-click the “bash” key and select New > Key.

Name it “command”.

With the “command” key selected in the left pane, double-click “(Default)” in the right pane and enter the following value:

You’re done. You can now right-click a folder in File Explorer and select “Open a Bash shell here” (or whatever you named the option) to quickly open a Bash shell to that specific folder. This option will appear immediately, so you don’t have to sign out or reboot first.

Use Our One-Click Registry Hack

Rather than doing all the registry editing work above, you can download our one-click .reg file. It does the exact same thing the above registry hack does. If you decide you want to remove the option, we’ve also included a one-click .reg file that will quickly remove the option.

Download our one-click “Add Bash to the Context Menu” registry hack and unzip the file. Double-click the “Add Bash to Your Context Menu.reg” file and agree to add the information to your registry to get the context menu option. Double-click the “Remove Bash From Your Context Menu.reg” file if you ever want to remove the option.

You should only add registry files from sources you trust. If you’re ever curious about what a .reg file does, you can right-click it in Windows and select “Edit” to inspect the .reg file and see exactly what information it will add or remove from your registry.

One of the really cool things about Windows 10 is that Microsoft has baked a full-blown Ubuntu-based Bash shell into the operating system. For those who might not be familiar with Bash, it is a text-based Linux command line environment. In other words, it is like having Linux on Windows, and now you can easily run Bash on Windows 10.

The Bash shell has actually been a part of Windows 10 for a while, but the technique used for enabling Bash on Windows 10 has changed over time. For the purposes of this article, I am going to assume that you are running Windows 10 with the Creators Update, or a newer version. If you are not sure which Windows 10 build you are using, then right click on the Start menu, and choose the System command from the shortcut menu. The resulting About Windows 10 screen lists various statistics about the operating system and the hardware that it is running on. Take a look at the OS Build, which you can see in the figure below. The build number I am basing this article is 15063.0 (version 1703). If your copy of Windows has an older build number (a lower number), then just run Windows Update to bring Windows up to date.

Be sure to check the OS Build before you get started

Bash on Windows 10: Let’s get started

Once you have checked the OS Build number, then the next step in the process is to install the Windows Subsystem for Linux. To do so, open an administrative PowerShell window, and run the following command:

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

You can see what this looks like in the next figure. You will also notice that installing this feature requires you to reboot your computer.

Enable the Windows Subsystem for Linux

Once the Windows Subsystem for Linux is installed, you are going to need to install Ubuntu user mode. Microsoft is talking about making it so that you can download Ubuntu from the Windows app store, but this option isn’t available just yet. For right now, you will have to enable Developer Mode, and then use the Command Prompt window to launch Bash.

Enabling Developer Mode is a simple enough process. Go to Settings, and then click on Update & Security. When you arrive at the Windows Update screen, click on the For Developers link. Next, you will have to turn on Developer Mode. As you can see in the figure below, Windows warns you that there are certain security risks associated with enabling Developer Mode, so you probably don’t want to use Developer Mode in a high-security environment.

Be sure to enable Developer Mode

It takes a minute or two for Developer Mode to be enabled. Once the process completes, go ahead and close the Settings window. The next thing that you will need to do is to open an administrative Command Prompt window. Microsoft has removed the Command Prompt option from the Start menu. You can launch a regular Command Prompt window by entering CMD at the Run prompt, but in this case we need an administrative Command Prompt. The easiest way to open an administrative Command Prompt window is to type the word Command into Cortana. You should see the Command Prompt listed among the search results. Right click on this result, and choose the option to run the Command Prompt as an administrator, as shown in the figure below.

Launch an administrative Command Prompt

When the Command Prompt window opens, type the word Bash, and press Enter. When you do, you will see a message saying that you are about to install Ubuntu on Windows, and that this is a beta feature. As you can see in the figure below, Windows gives you one last chance to change your mind about installing Bash. If you want to continue, then press Y.

After you press Y, Windows will download Ubuntu from the Windows app store. The interesting thing about this is that the download happens from within the Command Prompt interface, rather than using the usual Windows Store app. When the download completes, it takes Windows a few minutes to extract the Bash files.

Windows downloading Ubuntu from the Windows Store

When the extraction process finally completes, you will see a prompt telling you to enter a new UNIX username. This name will be used by the default UNIX user account, and the name that you choose does not have to match your Windows user name. The reason for this is that Windows maintains a completely separate authentication environment for Bash.

Bash shell

As you have probably already guessed, Windows also prompts you to enter and confirm a password to be used with the Bash on Windows 10 environment. Entering a password is a little bit disorienting, because nothing happens on screen to indicate that your key strokes are being registered. Finally, you are taken into the Bash shell, which you can see in the next figure.

Logged into Bash

There are two things to pay attention to in the screen capture above. First, the screen capture contains a message indicating that documentation is available at this Microsoft site.

The second thing to pay attention to is the message saying that if you want to run a command as Administrator (or root, as it is referred to in the Linux world), then you will need to use the word sudo. Let’s suppose, for instance, that you wanted to use the Date command to display the date, but for some crazy reason you needed to run that command as root. Here’s the commad you would use:
sudo date
As you can see in the example below, using the sudo option causes Bash to prompt you for a password.

Sudo command tells Bash to run the command as root

In case you are wondering, you don’t have to open a Command Prompt window every time you want to use the Bash on Windows 10 shell. The setup process installs a Start menu option that you can use in the future.

Chris Hoffman is Editor-in-Chief of How-To Geek. He’s written about technology for over a decade and was a PCWorld columnist for two years. Chris has written for The New York Times and Reader’s Digest, been interviewed as a technology expert on TV stations like Miami’s NBC 6, and had his work covered by news outlets like the BBC. Since 2011, Chris has written over 2,000 articles that have been read nearly one billion times—and that’s just here at How-To Geek. Read more.

Linux environments you install from the Store (like Ubuntu and openSUSE) keep their files in a hidden folder. You can access this folder to back up and view files. You can also access your Windows files from the Bash shell.

Don’t Modify Linux Files With Windows Tools

Microsoft strongly warns against adding or modifying Linux files with Windows software. This could cause metadata problems or file corruption, and may force you to uninstall and reinstall your Linux distribution to fix it. However, you can still view and back up your Linux files using Windows software, and that won’t cause any problems.

In other words, treat the Linux folder as if it were read-only from within Windows. Don’t use any Windows tool, including graphical apps or command line tools, to modify them. Don’t create new files within these folders using Windows tools, either.

If you do want to work with a file from both the Linux and Windows environments, you should create it in your Windows file system. For example, if you have a folder at C:\project in Windows, you could also access it at /mnt/c/project in the Linux environment. Because it’s stored on the Windows file system and is accessed under /mnt/c, it’s safe to modify the file with either Windows or Linux tools.

Where Windows Stores the Linux Files

Your Linux file system is stored in a hidden folder for a reason, as Microsoft doesn’t want you tampering with it. But, if you need to view or back up some files, you’ll find them stored in a hidden folder. To access it, open File Explorer and plug the following address into the address bar:

(This takes you to C:\Users\NAME\AppData\Local\Packages . You can also show hidden folders in File Explorer and navigate here manually, if you prefer.

In this folder, double-click the folder for the Linux distribution whose files you want to view:

  • Ubuntu: CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc
  • openSUSE Leap 42: 46932SUSE.openSUSELeap42.2_022rs5jcyhyac
  • SUSE Linux Enterprise Server 12: 46932SUSE.SUSELinuxEnterpriseServer12SP2_022rs5jcyhyac

The names of these folders may change slightly in the future. Just look for a folder named after the Linux distribution.

In the Linux distribution’s folder, double-click the “LocalState” folder, and then double-click the “rootfs” folder to see its files.

In other words, the files are stored at:

Note: In older versions of Windows 10, these files were stored under C:\Users\Name\AppData\Local\lxss. This changed starting with the Fall Creators Update.

To view the files stored in your home folder, double-click the “home” folder, and then double-click your UNIX username.

Remember, don’t modify any of these files or add files to these folders from File Explorer!

Where Your Windows System Drive Appears in Linux

The Windows Subsystem for Linux makes your full Windows system drive available so you can work with the same files in both environments. However, the Bash environment doesn’t just dump you in your C:\ drive. Instead, it places you in your UNIX account’s home directory within the Linux environment’s file system.

Your Windows system drive and other connected drives are exposed in the /mnt/ directory there, where other drives are traditionally made available in the Linux directory structure. Specifically, you’ll find the C: drive at the following location in the Bash environment:

To change to this directory with the cd command, just type:

If you have a D: drive, you’ll find it located at /mnt/d, and so on.

For example, to access a file stored at C:\Users\Chris\Downloads\File.txt, you’d use the path /mnt/c/Users/Chris/Downloads/File.txt in the Bash environment. And yes, it’s case-sensitive, so you need “Downloads” and not “downloads.”

You can also mount external drives and network locations to access more files from within the Linux environment.

Note that, when accessing Windows system files, your Bash shell environment has the permissions it was launched with. If you launched it normally from the shortcut, it will have the same file access permissions your Windows user account does.

For example, if you want to access a system folder your user account doesn’t have permission to access, you’d need to right-click the Bash shell shortcut and select “Run as Administrator” to launch the Bash shell with Windows Administrator privileges.

This works just like the Command Prompt, which needs to be launched as Administrator if you need write access to Administrator-only files, or write access to system files. You can’t just use sudo in the Bash environment.

How can I launch a new Git Bash window with a specified working directory using a script (either Bash or Windows batch)?

My goal is to launch multiple Git Bash windows from a single script, each set to a different working directory. This way I can quickly get to work after booting the computer instead of having to open Git Bash windows and navigating each one to the correct working directory.

I am not asking how to change the default working directory, like this question does, but to launch one or more terminal windows with different working directories from a script.

10 Answers 10

You can now choose to sort by Trending, which boosts votes that have happened recently, helping to surface more up-to-date answers.

Trending is based off of the highest score sort and falls back to it if no posts are trending.

Another option is to create a shortcut with the following properties:

Target should be:

“%SYSTEMDRIVE%\Program Files (x86)\Git\bin\sh.exe” –login

Start in is the folder you wish your Git Bash prompt to launch into.

Try the –cd= option. Assuming your GIT Bash resides in C:\Program Files\Git it would be:

“C:\Program Files\Git\git-bash.exe” –cd=”e:\SomeFolder”

If used inside registry key, folder parameter can be provided with %1:

“C:\Program Files\Git\git-bash.exe” –cd=”%1″

Git Bash uses cmd.exe for its terminal plus extentions from MSYS/MinGW which are provided by sh.exe , a sort of cmd.exe wrapper. In Windows you launch a new terminal using the start command.

Thus a shell script which launches a new Git Bash terminal with a specific working directory is:

An equivalent Windows batch script is:

To get the same font and window size as the Git Bash launched from the start menu, it is easiest to copy the start menu shortcut settings to the command console defaults (to change defaults, open cmd.exe , left-click the upper left icon, and select Defaults).

Let yet add up to the answer from @Drew Noakes:

Target:

The cd param should be one of the options how to specify the working directory.

Also notice, that I have not any –login param there: Instead, I use another extra app, dedicated just for SSH keys: Pageant (PuTTY authentication agent).

Start in:

The same possible way, as @Drew Noakes mentioned/shown here sooner, I use it too.

Shortcut key:

Such shortcuts are another less known feature in Windows. But there is a restriction: To let the shortcut take effect, it must be placed somewhere on the User’s subdirectory: The Desktop is fine.

If you do not want it visible, yet still activatable, place this .lnk file i.e. to the quick launch folder, as that dir is purposed for such shortcuts. (no matter whether displayed on the desktop) #76080 #3619355

In addition, Win10 gives you an option to open git bash from your working directory by right-clicking on your folder and selecting GitBash here.

This is basically @lengxuehx’s answer, but updated for Win 10, and it assumes your bash installation is from Git Bash for Windows from git’s official downloads.

cmd /c (start /b “%cd%” “C:\Program Files\GitW\git-bash.exe”) && exit

I ended up using this after I lost my context-menu items for Git Bash as my command to run from the registry settings. In case you’re curious about that, I did this:

  1. Create a new key called Bash in the shell key at HKEY_CLASSES_ROOT\Directory\Background\shell
  2. Add a string value to Icon (not a new key!) that is the full path to your git-bash.exe, including the git-bash.exe part. You might need to wrap this in quotes.
  3. Edit the default value of Bash to the text you want to use in the context menu
  4. Add a sub-key to Bash called command
  5. Modify command ‘s default value to cmd /c (start /b “%cd%” “C:\Program Files\GitW\git-bash.exe”) && exit

Then you should be able to close the registry and start using Git Bash from anywhere that’s a real directory. For example, This PC is not a real directory.

I know that in the Mac OS10, people use the open . command to open the current directory.

Does anybody please know the appropriate command to do the same task under Bash on Windows?

16 Answers 16

You can now choose to sort by Trending, which boosts votes that have happened recently, helping to surface more up-to-date answers.

Trending is based off of the highest score sort and falls back to it if no posts are trending.

it will open the current the directory folder.

You can now call explorer.exe from the bash subsystem. I’ve set up an alias to use it. I’ve added the copy to clipboard alias as well for good measure.

Alias:

Example:

The open alias plays well with . , but you’ll need to pass it the Windows path if you want to specify a directory.

Right now Microsoft don’t recommend to mix Windows explorer with the bash shell. In latest win10 Insider builds you could use from bash something like this

If you are using Win10 Anniversary Edition you could try installing a Desktop Environment. Start reading this https://github.com/microsoft/bashonwindows/issues/637 After that you could open a window with the present folder content with

I’m using this function:

So if you are in /mnt/c/Users/ and would like to open that folder, just type open .

wslpath will resolve only paths from the Windows system, be aware. If you are looking to do something like open

it will not work, and you will get:

wslpath: /home/my-user: Result not representable

A proof that this works:

You Can Use the following command: explorer .

to the .bashrc file

opens current folder when typed open

I’m using windows ubuntu subsystem.

This command should do it:

If start . doesn’t work for you, it’s essentially the same as running explorer.exe . so you can create an alias for it which is what I did.

Side note: Another useful one to have is BROWSER . explorer.exe is capable of starting your default web browser. This comes in handy when you run scripts that open a web browser like starting a React.js development server.

start . – this is the equivalent of open . in bash

This will work on bash command in windows. I was using R studio and was able to open the directory.

To work in all type of paths (Windows-Style and Linux-Style), do as following (the answer of mine to my own question on SU):

(Here my challenge was how I could open Explorer in current working directory with Linux-Style path for view purposes, if you are going into modification or do something else other than just viewing, this is at your own risk, please also read Do not change Linux files using Windows apps and tools):

this will open the Explorer exactly in your working directory. The only thing you need is now define a function to get it to work. You can add this into your .bashrc and source it or re-open Bash.

Note: Replace userName with your Windows User account name there.

Bash is the command-line interface for Linux distributions like Ubuntu, CentOS, Debian, Mint, Kali, RedHat, Fedora, etc. Bash provides a lot of different types of commands and tools to manage a Linux system. In this tutorial, we will learn how to install Bash on a Windows operating system like Windows 10.

What Is Bash?

Bash is the most popular shell or command line used in Linux distributions. Bash alternatives are Sh, KornShell, CShell, etc. Bash is the short form of the GNU Bourne-Again Shell and created in 1989 by the GNU supporter Free Software Foundation (FSF).

Windows Subsystem for Linux (WSL)

Containers are a new era of Virtualization where provides less resource usage and less complexity. Containers provide isolated environments for applications, processes, files, etc like a virtual system. Docker is the most known and popular containerization system. Windows also started full and complete container usage on Windows for Linux. It is called Windows Subsystem for Linux (WSL). This means the Linux operating system calls and standards are provided as a container on a Windows operating system. WSL is currently supported by the modern Windows operating systems like Windows 10 and Windows Server 2016 and 2019.

Bash Installation

In order to install Bash on Windows, we will enable the WSL and download a Linux container image like Ubuntu, SUSE, etc from Microsoft store. Then we will run this container from the Windows command line MS-DOS or PowerShell.

Enable Windows Subsystem For Linux

First, we will enable or install Windows Subsystem For Linux (WSL) with the PowerShell. We need Administrative features enabled by running PowerShell from Start Menu where we will right-click and then select Run as administrator .

We will run the following Enable-WindowsOptionalFeature command in order to install and enable Microsoft-Windows-Subsystem-Linux feature.

We will be asked is we want to restart the computer after the installation is complete. We will answer Y .

This will restart the system automatically in order to start the Windows with the WSL enabled.

Download Linux Image/Distributions From Windows Store

In order to run bash, we have to download a Linux image/distributions which will provide the bash shell. Linux distributions can be downloaded from the Microsoft Store like below. We can access Microsoft Store from start menu with Microsoft Store keyword.

We will write linux to the search box and search. Alternatively, if we are looking for a specific Linux

The search results for the Linux container will be listed below. We can see that Linux distributions like Kali, Ubuntu, Debian, Suse, etc. The following information also provided with the search results.

  • Popularity provides the count of the rating provided the given Linux distribution image.
  • Rating is the provided points or starts for the given Linux distribution.
  • Supported Systems shows which environments can run given Linux image like Computer, Phone, etc.
  • Price is generally zero but used to show the price of the given Linux image.

We will select the Linux distribution like Kali, Ubuntu, Debian, SUSE like below just click them. In this example, we will select the Ubuntu image with the latest version. Ubuntu 18.04 LTS can be downloaded for Lon Term Support.

During the download, the download status will be shown in the header like below. We can see that the Ubuntu image is about 221 MB and downloaded very fast.

Launch Bash From Microsoft Store

When the download is complete we can launch Ubuntu container from the Microsoft Store from the Launch button like below.

We will see the following bash shell where it is initialized for the first run. As it says it may take a few minutes to see the shell.

Before starting to use bash we will be asked some basic questions like the username and password which will set. In this example, we set the username ismail . The password is not shown for security reasons. We see that the hostname part of the bash shell is the name of the computer which is DESKTOP-HQVAMA3 and the user name is ismail .

Start Bash From MS-DOS and PowerShell

We can also start the Bash from the command line. MS-DOS or PowerShell can be used to start bash shell with the bash command like below.

Run Bash Commands On Windows

We can run any Linux bash command on Windows like below. In this part, we will run commands like ping , uname , lsb-release .

Access Windows Drives C:\ , D:\

After starting the bash on Windows we may need to access Windows partitions like C:\, D:\, and the users Documents and Settings folders. These partitions and folders are mounted in /mnt directory with their partition names. In this following example, we see the folders are listed in the C:\ partition.

Comments

Manouchehri commented Jun 30, 2016

We should have a context menu that gives an option to open Bash in the current folder.

The text was updated successfully, but these errors were encountered:

Manouchehri commented Jun 30, 2016

I have already written a reg file if anyone wants to add it now.

Manouchehri commented Jun 30, 2016

benhillis commented Jun 30, 2016 •

Thanks, this is great! One change you should consider making though is remove the hardcoded C:\Windows portion of the path which will only work for user’s who have C:\Windows as their Windows directory. You can fix this by using a REG_EXPAND_SZ registry value. Here’s what bash.reg would look like:

factormystic commented Jun 30, 2016

Also there’s no need to write to HKCR. If you really do want it to be available for all users, write to HKLM\Software\Classes. If you only want it to apply to the current user, write to HKCU\Software\Classes.

fpqc commented Jun 30, 2016

Yeah, seems like it should be per-user.

Manouchehri commented Jul 11, 2016

@benhillis Any update on this?

benhillis commented Jul 11, 2016

Unfortunately this change will not be in the Windows 10 anniversary update. Thanks for providing the reg key, I think many users will want this functionality and luckily it is easy to achieve with a simple reg key import.

JamesEarle commented Aug 3, 2016

Thanks for the reg key! Any word on this being incorporated into future updates?

TimothyBramlett commented Aug 6, 2016

Yeah, please get this incorporated ASAP. Because the other windows directories are mounted in mnt it makes it to where you cant just easily copy and paste paths from explorer. So, this is the quickest way to quickly open up the current explorer directory you are viewing, in bash.

fpqc commented Aug 6, 2016

TimothyBramlett I bet @xilun could add something to cbwin like “wcd” that would do patht translation back from Windows paths to linux ones.

xilun commented Aug 6, 2016

@fpqc It’s quite easy to program but a little bit out of scope on my side. also you would have to single quote escape it due to backslashes – not very convenient. I think ConEmu does path translation on paste, but then of course when you use ConEmu and WSL at the moment there is the current issue of WSL / console keys not working well outside of an unwrapped Windows Console.

saschanaz commented Oct 24, 2016

I’m always getting “/mnt/c/Windows/System32”, how can I get “current directory”?

Manouchehri commented Oct 25, 2016

Please use ConEmu instead, it’s much better than my method.

On Oct 24, 2016 9:02 AM, “Kagami Sascha Rosylight” [email protected]
wrote:

I’m always getting “/mnt/c/Windows/System32”, how can I get “current
directory”?

bitcrazed commented Feb 21, 2017

One of the reasons we can’t support file explorer context menu extensions is because we can’t launch bash at an arbitrary folder location.

We have it on our backlog to fix for a future release.

mklement0 commented Feb 27, 2017

Here’s a working solution that uses an aux. cmd command to change to the target directory first, which therefore comes with a caveat: the resulting Bash console window will therefore have cmd.exe ‘s icon and will be grouped with regular cmd.exe in the taskbar.

If you save the following text in a *.reg file and open (double-click) it, you’ll be prompted to import the definitions into your user-specific registry hive.

After import, you’ll find a Bash Console Here command in the context menu of folders in File Explorer, and also when you click in the empty space inside a folder.
On selecting that command, a Bash console window will open in that folder.

Alternatively, you can use the following PowerShell snippet to create the registry entries:

To remove the entries later:

Tetheta commented Oct 17, 2017

This works great and all, but at this point definitely seems like a feature that should be an option to have baked in. Any ideas on if there are plans for that?

SplittyDev commented Apr 6, 2018

Any news on that issue?

Brian-Perkins commented May 9, 2018

Support for a context menu item was added in build 17666.

mkarpoff commented May 31, 2018

Something I’ve noticed is that if you use the open bash here context menu. It doesn’t use any of your wsl console settings (eg. colors, fonts, window and font size)

sunilmut commented May 31, 2018

@bitcrazed – Could @mkarpoff’s report be console related?

fpqc commented Jun 1, 2018

@sunilmut without a doubt it is console-related.

bitcrazed commented Jun 7, 2018

@mkarpoff As described in our post explaining how Console settings are resolved, when you launch a distro via Explorer context menu, the Console will look for settings in the following locations and order:

  1. Launching shortcut (none in this case)
  2. App-specific settings in the Registry
  3. Default Console settings in the Registry

As noted above, when you launch via the context menu, you’re not launching via a tile, so Console will look for distro settings, or default Console settings from the registry.

If you launch your distro from a start menu tile, or shortcut pinned to your taskbar, your Console settings for that distro will be stored in that tile/shortcut but won’t be found/used when launching via the context menu.

Alas, we can’t change this behavior in Console as it stands today, because doing so would break MANY users’ expected behaviors, etc.

However, we are looking at how we might rationalize, simplify, and improve settings in the future.

eromoe commented Apr 22, 2019

@Brian-Perkins Could you consider adding an icon ?
shift context menu would show powershell and linux shell

This would look ugly with some menu-items had icon

Footer

© 2022 GitHub, Inc.

You can’t perform that action at this time.

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.

Spustit Bash v systému Windows 10 a automaticky se otevře domovskému adresáři účtu UNIX. Spíše než použít příkaz cd pro změnu na jinou složku, můžete spustit Bash přímo ze složky v aplikaci Průzkumník souborů.

Můžete to provést bez jakýchkoli zásahů registru nebo změn. Je to skryté. Ale pokud jste ochotni se ponořit do registru, můžete to udělat trochu výhodnější. Zde jsou naše dvě doporučené metody:

Aktualizace : Pokud máte nainstalované více prostředí Linux, můžete pomocí příkazu wslconfig vybrat výchozí prostředí Linux, které se zobrazí při spuštění příkazu bash .

Jednoduchá volba: Použijte adresní lištu

SOUVISEJÍCÍ: Vše, co můžete dělat s novým Bash Shell systému Windows 10

Chcete-li spouštět bash v určité složce, Průzkumník obvykle. Klepněte na adresní řádek v této složce, zadejte příkaz “bash” a stiskněte klávesu Enter.

Zobrazí se okno s příkazem Bash zaměřené na zvolený adresář

Například pokud zadáte “bash” kořen jednotky C: Bash se otevře s vybraným adresářem / mnt / c

Možnost pravého kliknutí: Přidání volby kontextové nabídky úpravou registru

d má spíše volbu kontextového menu, jako je volba “Otevřít okno příkazu zde”, které se zobrazí, když držíte klávesu Shift a kliknete pravým tlačítkem myši uvnitř složky v Průzkumníku souborů.

Chcete-li získat tento druh zkratky Bash, budete muset upravit registru a přidat tuto funkci sami. Pokud byste to nechtěli udělat ručně, máme namísto toho soubor rychlého souboru .reg

Standardní upozornění: Editor registru je mocný nástroj a jeho zneužití může způsobit, že systém bude nestabilní nebo dokonce nefunkční. To je docela jednoduchý hack a pokud budete držet pokynů, neměli byste mít žádné problémy. Pokud jste s tím dosud nikdy nepracovali, zvažte, jak začít používat Editor registru. A před provedením změn určitě zálohujte registr (a váš počítač!)

Nejprve otevřete editor registru stisknutím klávesy Windows, zadáním příkazu “regedit” do nabídky Start a stisknutím klávesy “Enter”. na následující klíč:

HKEY_CLASSES_ROOT Directory Background shell

. Můžete mu pojmenovat vše, co chcete. Tento název se v systému Windows neobjevuje nikde a používá se pouze ke sledování záznamu v registru.

V levém podokně vyberte položku “bash” (nebo jakkoli jste jej pojmenovali)

Poklepejte na položku “(Výchozí)” v pravém podokně a zadejte jakékoliv jméno, které chcete zobrazit v kontextovém menu aplikace Průzkumník souborů. Například můžete zadat “Otevřít shell Bash zde” nebo jen “Bash”

Dále klikněte pravým tlačítkem myši na tlačítko “bash” a zvolte New> Key

Pomocí klávesy “příkaz” vybraného v levém podokně poklepejte na pravý panel v pravém podokně a zadejte následující hodnotu:

C: Windows System32 bash.exe

jste hotovi . Nyní můžete kliknout pravým tlačítkem myši na složku v aplikaci Průzkumník souborů a vybrat “Otevřít shell Bash zde” (nebo jakkoli jste pojmenovali tuto možnost), abyste mohli rychle otevřít shell Bash do této konkrétní složky. Tato volba se objeví okamžitě, takže se nejprve nepotřebujete odhlásit nebo restartovat.

Spíše než vyřešit všechny výše popsané úpravy registru, můžete stahovat jedno kliknutí. reg soubor. To dělá přesně totéž, co hore uvedený registru hack dělá. Pokud se rozhodnete, že chcete tuto možnost odstranit, zahrnovali jsme také soubor .reg s jedním klepnutím, který tuto možnost rychle odstraní.

Stáhněte si náš klepnutí “Přidat bash do kontextové nabídky” a rozbalte soubor. Poklepejte na soubor “Přidat bash do vašeho kontextového menu.reg” a souhlaste s přidáním informací do registru, abyste získali možnost kontextové nabídky. Pokud někdy chcete odstranit tuto možnost, poklepejte na soubor “Odstranit bázu z vašeho kontextového menu.reg”.

Soubory registru byste měli přidávat pouze ze zdrojů, kterým důvěřujete. Pokud jste někdy zvědaví, co soubor .reg dělá, můžete kliknout pravým tlačítkem myši v systému Windows a vybrat “Upravit” pro kontrolu souboru .reg a přesně vidět, jaké informace bude přidávat nebo odebrat z vašeho registru.

Rozdíly v sekci v aplikaci Word umožňují rozdělit dokument do sekcí a formátovat jednotlivé sekce jinak. Při vytváření nového dokumentu je ve výchozím nastavení pouze jedna sekce, ale můžete podle potřeby přidat různé typy oddílů. SOUVISEJÍCÍ: Změňte typ pro zlomek oddílu v aplikaci Word 2007 a 2010 Co chcete-li změnit typ zlomku oddílu nebo odstranit zlomek oddílu v dlouhém dokumentu s mnoha přestávkami v sekci?

How do I run a Linux command in Windows 10?

How to Enable the Linux Bash Shell in Windows 10

  1. Navigate to Settings. …
  2. Click Update & security.
  3. Select For Developers in the left column.
  4. Select Developer Mode under “Use developer features” if it’s not already enabled.
  5. Navigate to the Control Panel (the old Windows control panel). …
  6. Select Programs and Features. …
  7. Click “Turn Windows features on or off.”

How do I switch from Windows 10 to Linux?

Begin typing “Turn Windows features on and off” into the Start Menu search field, then select the control panel when it appears. Scroll down to Windows Subsystem for Linux, check the box, and then click the OK button. Wait for your changes to be applied, then click the Restart now button to restart your computer.

What can I do with Linux on Windows 10?

Everything You Can Do With Windows 10’s New Bash Shell

  1. Getting Started with Linux on Windows. …
  2. Access Windows Files in Bash, and Bash Files in Windows. …
  3. Switch to Zsh (or Another Shell) Instead of Bash. …
  4. Run Linux Commands From Outside the Linux Shell. …
  5. Run Graphical Linux Desktop Programs. …
  6. Quickly Launch Bash From File Explorer. …
  7. Uninstall and Reinstall a Linux Environment.

How do I run Linux on Windows?

Virtual machines allow you to run any operating system in a window on your desktop. You can install the free VirtualBox or VMware Player, download an ISO file for a Linux distribution such as Ubuntu, and install that Linux distribution inside the virtual machine like you would install it on a standard computer.

Can I practice Linux commands online?

Say hello to Webminal, a free online learning platform that allows you to learn about Linux, practice, play with Linux and interact with other Linux users. Just open your web browser, create a free account and start practicing! It’s that simple. You don’t have to install any additional applications.

How do I run a Linux command?

Launch a terminal from your desktop’s application menu and you will see the bash shell. There are other shells, but most Linux distributions use bash by default. Press Enter after typing a command to run it. Note that you don’t need to add an .exe or anything like that – programs don’t have file extensions on Linux.

Can I replace Windows 10 with Linux?

While there really isn’t anything you can do about #1, taking care of #2 is easy. Replace your Windows installation with Linux! … Windows programs typically will not run on a Linux machine, and even the ones that will run using an emulator such as WINE will run slower than they do under native Windows.

How do I remove Linux and install Windows on my computer?

To remove Linux from your computer and install Windows:

  1. Remove native, swap, and boot partitions used by Linux: Start your computer with the Linux setup floppy disk, type fdisk at the command prompt, and then press ENTER. …
  2. Install Windows.

Does Linux run faster than Windows 10?

Linux and Windows Performance Comparison

Linux has a reputation for being fast and smooth while Windows 10 is known to become slow and slow over time. Linux runs faster than Windows 8.1 and Windows 10 along with a modern desktop environment and qualities of the operating system while windows are slow on older hardware.

What are the disadvantages of Linux?

Disadvantages of Linux OS:

  • No single way of packaging software.
  • No standard desktop environment.
  • Poor support for games.
  • Desktop software is still rare.

Can Linux replace Windows?

Desktop Linux can run on your Windows 7 (and older) laptops and desktops. Machines that would bend and break under the load of Windows 10 will run like a charm. And today’s desktop Linux distributions are as easy to use as Windows or macOS. And if you’re worried about being able to run Windows applications — don’t.

Is Windows Subsystem for Linux good?

WSL takes away some of the desire for developers to use macs. You get modern apps like photoshop and MS office and outlook and also can run the same tools you’d need to be running to do dev work. I find WSL infinitely useful as an admin in a hybrid windows/linux environment.

How do I get Linux on my computer?

Installing Linux using USB stick

  1. Step 1) Download the .iso or the OS files on your computer from this link.
  2. Step 2) Download free software like ‘Universal USB installer to make a bootable USB stick.
  3. Step 3) Select an Ubuntu Distribution form the dropdown to put on your USB.
  4. Step 4) Click YES to Install Ubuntu in USB.

How can I run Linux on Windows without Virtual Machine?

OpenSSH runs on Windows. Linux VM’s run on Azure. Now, you can even install a Linux distribution directory on Windows 10 natively (without using a VM) with the Windows Subsystem for Linux (WSL).

Account Information

Share with Your Friends

Windows 10: How to add Ubuntu Bash to the Start menu

Windows 10: How to add Ubuntu Bash to the Start menu

A step-by-step guide to making Ubuntu Bash available in a few clicks on Windows 10.

A recent upgrade to early versions of Windows 10 added the ability for the OS to easily run a selection of native Linux software.

Test builds of Windows 10 available under the Windows Insider program can run the Bash shell, a command line interpreter that is available in many different Linux distributions, as well as Mac OS X.

The shell includes tools that allow power users to execute complex chains of commands and automate them using scripts.

Bash is available via a Universal Windows Platform app. The app runs on the Windows 10 desktop and provides an image of the Linux-based OS Ubuntu that Bash runs on. A selection of native Ubuntu command line software can be installed — such as the version control tool Git and the compiler gcc — and, in general, applications seem perform relatively well.

To add the Bash app to your Start menu in Windows 10, you’ll first need to be signed up to test Windows 10 as part of the Windows Insider program, which you can join by following the steps here.

Once your Windows 10 Insider build is up and running these are the steps you need to take to add Ubuntu Bash to the Start menu:

Step by step guide

  1. Switch to the Fast Ring

To be able to use Bash on Ubuntu on Windows you’ll need to be in the Windows Insider Fast Ring, which will give you access to the latest Windows 10 test builds.

To enable this go to the Start menu, click Settings ->Update & security -> Advanced options (Figure A)

Figure A

Near the bottom of the ‘Advanced options’ window is written ‘Choose your Insider level’. Below this text is a blue bar with a slider on it. Pull this slider to the right edge of the bar. This should select the ‘Fast Ring’ (Figure B).

Figure B

After a period, often several hours, Microsoft will switch you to the Fast Ring and Windows Update will begin downloading the latest Windows 10 build, which includes access to Bash on Ubuntu on Windows.

Turn on Developer Mode

Once your machine is updated, you’ll need to enable Developer Mode. From the Start menu go to Settings -> Update & security. From this page click on the ‘For developers’ option in the lefthand sidebar (Figure C).

Figure C

Click the ‘Developer mode’ radio button and click ‘Yes’ on the pop-up window titled ‘Use developer features’ (Figure D).

Figure D

Now reboot the machine.

Enable ‘Windows Subsystem for Linux’

Search for “Windows Features” in the Taskbar and select “Turn Windows features on or off”(Figure E)

Figure E

Scroll down to the bottom of the ‘Windows Features’ window and tick the checkbox labelled ‘Windows Subsystem for Linux’.

Figure F

Install Bash on Ubuntu

Click the search box on the Taskbar and type ‘cmd’. Open the Command Prompt (Figure G).

Figure G

Type ‘bash’ into the command line, hit return, and Windows will begin installing Bash on Ubuntu (Figure H). Accept the terms of service and it will download Ubuntu – which may take some time depending on the speed of your internet connection.

Figure H

Following the install, you’ll be placed into Bash running Ubuntu 14.04 on the Windows Subsystem for Linux (Figure I).

Figure I

Add Bash on Ubuntu to the Start menu

Close the command prompt and search for ‘Ubuntu’ in the Taskbar. Right click on the ‘Bash on Ubuntu on Windows’ icon and click ‘Pin to Start’ (Figure J).

Figure J

Click on the Start menu and you can see the Bash on Ubuntu on Windows pinned as a tile and ready to use (Figure K).

Figure K

Once in Bash, if you want to access your Windows files, type ‘cd mnt/’ — replacing ‘’ with the letter of your main Windows drive.

2022-March-22В As of today, this evolvingвЃ [1] article has been on the web for

About Git Bash

Git Bash is a Windows command-line shell that is packaged with Git for Windows. It emulates the bash shell that is familiar to nix-nux users.⁠[2] ⁠[3] To learn about Git Bash, see Infinite Ink’s Git Bash Is My Preferred Windows Shell and #git-⁠bash Portal.

About terminal emulators

To interact⁠[4] with Git Bash and command-line shells in general, humans use a terminal emulator. A terminal emulator can be either a standalone app, for example ConEmu, or integrated into another app, for example Visual Studio Code’s integrated terminal. To view a list of standalone terminal emultors, see Wikipedia’s List of terminal emulators.

About bin/bash.exe versus usr/bin/bash.exe

In the sections below, sometimes bin/bash.exe is used and sometimes usr/bin/bash.exe is used. Both of these launch Git Bash and the only difference — as far as I can tell — is that bin/bash.exe executes usr/bin/bash.exe as a login shell.

Launch Git Bash in Git Bash’s default terminal emulator (Mintty)

If you install Git Bash with the default GitВ forВ Windows set-up options, you will easily be able to launch Git Bash in the Mintty terminal emulator from Windows File Explorer or from a Windows Desktop shortcut.

Launch via File Explorer

In Windows File Explorer, right-click any folder and choose GitВ BashВ Here in the pop-up context menu. This launches Git Bash in Mintty with the right-clicked folder as the working directory.

Launch via a desktop shortcut

If you double click the GitВ Bash shortcut on your Windows Desktop, it will launch Git Bash in Mintty with your home directoryВ (

) as the working directory.

If you right-click on the default Desktop GitВ Bash shortcut and choose Properties, you will see something like the following.

You can change these shortcut properties if you like. For example, to start in the C:\ directory, use this:

To start in a directory specified by an environment variable, use something like this:

git-bash.exe runs mintty.exe . To launch GitВ Bash in a non-Mintty terminal, use git-вЃ cmd.exe , examples of which are in the next two sections.

Launch Git Bash in the ConEmu terminalВ emulator

The easiest way to set up ConEmu to launch GitВ Bash is to do the following inВ thisВ order:

Install GitВ forВ Windows, which includes GitВ Bash.

If you install these apps in this order, the following will automatically be one of the options in ConEmu’s list.

Then all you have to do is choose this option and it will justВ work.вЃ рџ‘Џ

If you need to manually add a ConEmu startup task for GitВ Bash, follow the instructions at conemu.github.io/en/GitForWindows.html. In March 2021, this command is recommended:

Launch Git Bash in Visual Studio Code’s integrated terminal emulator

To use Git Bash in VS Code’s integrated terminal emulator, do the following two steps.

Follow the GitВ Bash instructions at code.visualstudio.com/docs/editor/integrated-terminal. In MarchВ 2021, the VS Code documentation suggested including thisвЃ [5] in your settings.json :

If the Backspace key does not work, set your Git Bash TERM environment variable to cygwin or xterm . How to do this is discussed in Infinite Ink’s Git Bash Is My Preferred Windows Shell in the

Launch Git Bash in IntelliJ IDEA’s integrated terminal emulator

To learn about IntelliJ IDEA’s integrated terminal emulator, see www.jetbrains.com/help/idea/settings-tools-terminal.html. On that page, there are seven “ShellВ path” examples, but unfortunately GitВ Bash is not one of the examples. The following is suggested for Cygwin:

Since Git Bash is similar to Cygwin, I tried this:

And it worked!вЃ [5]

Launch Git Bash in Vim’s integrated terminal emulator

In Vim v8.1 and newer, you can launch an integrated terminal emulator with the :terminal or :term command. On my Windows devices, these equivalent commands launch the old Windows shell called CMD (also known as cmd.exe and “Command Prompt”). To launch Git Bash instead of CMD, typing this sequence within Vim works for me.

To exit this integrated Vim terminal emulator, I type the following sequence of commands.

This :term bash -li command works because Git Bash’s bash.exe is the first bash on my path.

Vim’s default is to open the terminal window above the current buffer. To open it below, put this in your vimrc  file: set splitbelow

To prevent Vim from displaying a warning that Terminal is not fully functional , set Git Bash’s TERM environment variable to cygwin or xterm .

Launch Git Bash in the Windows Terminal terminal emulator

To use Git Bash with Microsoft’s Windows Terminal, which is also known as wt.exe , follow the instructions at github.com/microsoft/terminal/blob/main/doc/user-docs/ThirdPartyToolProfiles.md. In April 2021, this⁠[5] JSON fragment is suggested:

You may want to change the highlighted line above to this:

This may be better because…

bin\bash.exe calls usr\bin\bash.exe and it should use less memory to directly call usr\bin\bash.exe ;

On the other hand, it may or may not be better because of reasons discussed in…

For more about this, see Microsoft’s Windows Terminal General Profile Settings. If you have thoughts about what is the best way to launch GitВ Bash in Windows Terminal, please comment below.вЃ

See also

For more about Git Bash, see Infinite Ink’s…

Windows 10 isn’t the only (kind of) free operating system you can install on your computer. … Installing a Linux distribution alongside Windows as a “dual boot” system will give you a choice of either operating system each time you start your PC.

Can I install Linux on Windows 10?

Linux is a family of open-source operating systems. They are based on the Linux kernel and are free to download. They can be installed on either a Mac or Windows computer.

Is it possible to install Linux on Windows?

There are two ways to use Linux on a Windows computer. You can either install the full Linux OS alongside Windows, or if you are just starting with Linux for the first time, the other easy option is that you run Linux virtually with making any change to your existing Windows setup.

How do I use Linux on Windows 10?

  1. Navigate to Settings. …
  2. Click Update & security.
  3. Select For Developers in the left column.
  4. Navigate to the Control Panel (the old Windows control panel). …
  5. Select Programs and Features. …
  6. Click “Turn Windows features on or off.”
  7. Toggle “Windows Subsystem for Linux” to on and click Ok.
  8. Click the Restart Now button.

What can I do with Linux on Windows 10?

Everything You Can Do With Windows 10’s New Bash Shell

  1. Getting Started with Linux on Windows. …
  2. Access Windows Files in Bash, and Bash Files in Windows. …
  3. Switch to Zsh (or Another Shell) Instead of Bash. …
  4. Run Linux Commands From Outside the Linux Shell. …
  5. Run Graphical Linux Desktop Programs. …
  6. Quickly Launch Bash From File Explorer. …
  7. Uninstall and Reinstall a Linux Environment.

Is Windows 10 better than Linux?

Linux has good performance. It is much quicker, fast and smooth even on the older hardware’s. Windows 10 is slow compared to Linux because of running batches at the back end, requiring good hardware to run. Linux updates are easily available and can be updated/modified quickly.

Is the Linux operating system free?

Linux is a free, open source operating system, released under the GNU General Public License (GPL). Anyone can run, study, modify, and redistribute the source code, or even sell copies of their modified code, as long as they do so under the same license.

Can you install Linux on any laptop?

A: In most cases, you can install Linux on an older computer. Most laptops will have no problems running a Distro. The only thing you need to be wary of is hardware compatibility. You may have to do some slight tweaking to get the Distro to run properly.

How do I enable Linux on Windows?

Begin typing “Turn Windows features on and off” into the Start Menu search field, then select the control panel when it appears. Scroll down to Windows Subsystem for Linux, check the box, and then click the OK button. Wait for your changes to be applied, then click the Restart now button to restart your computer.

What is the best Linux operating system?

1. Ubuntu. You must have heard about Ubuntu — no matter what. It is the most popular Linux distribution overall.

Does Windows 10 have bash?

One of the really cool things about Windows 10 is that Microsoft has baked a full-blown Ubuntu-based Bash shell into the operating system. For those who might not be familiar with Bash, it is a text-based Linux command line environment.

Can I practice Linux commands online?

Say hello to Webminal, a free online learning platform that allows you to learn about Linux, practice, play with Linux and interact with other Linux users. Just open your web browser, create a free account and start practicing! It’s that simple. You don’t have to install any additional applications.

Can I run bash script on Windows?

With the arrival of Windows 10’s Bash shell, you can now create and run Bash shell scripts on Windows 10. You can also incorporate Bash commands into a Windows batch file or PowerShell script. Even if you know what you’re doing, this isn’t necessarily as simple as it seems.

What are the disadvantages of Linux?

Disadvantages of Linux OS:

  • No single way of packaging software.
  • No standard desktop environment.
  • Poor support for games.
  • Desktop software is still rare.

Is Windows Subsystem for Linux good?

WSL takes away some of the desire for developers to use macs. You get modern apps like photoshop and MS office and outlook and also can run the same tools you’d need to be running to do dev work. I find WSL infinitely useful as an admin in a hybrid windows/linux environment.

Is wsl2 faster?

WSL 1 offers faster access to files mounted from Windows. If you will be using your WSL Linux distribution to access project files on the Windows file system, and these files cannot be stored on the Linux file system, you will achieve faster performance across the OS files systems by using WSL 1.