Search code examples
linuxwindows-subsystem-for-linux

How to open a wsl directory in git bash terminal


I want to open this \\wsl.localhost\Ubuntu wsl directory in git bash terminal. My git bash terminal is currently open in /c/Users/DELL directory.

I tried \\wsl.localhost\Ubuntu pasting this command in the bash shell, but it throws error saying that bash: \wsl.localhostUbuntu: No such file or directory .

Can anybody help me opening that in git bash terminal.

Few days back i managed it to open that in git bash, see this image enter image description here

But now I am unable to do so, don't know how I managed to do so earlier


Solution

  • Run this command:

    cd //wsl.localhost/Ubuntu
    

    The command \\wsl.localhost\Ubuntu didn't work, because

    1. Bash removes backslashes while parsing the command (solution: use forward slashes: /).

    2. You didn't indicate that you want to change the current directory, without that Bash interpreted your command as running an external program by that name (solution: use the cd command).