英文:
How to open a wsl directory in git bash terminal
问题
我想在git bash终端中打开这个\\wsl.localhost\Ubuntu
wsl目录。我的git bash终端当前打开在/c/Users/DELL
目录。
我尝试在bash shell中粘贴\\wsl.localhost\Ubuntu
这个命令,但它会抛出错误,显示bash: \wsl.localhostUbuntu: No such file or directory
。
有人可以帮我在git bash终端中打开吗?
但现在我无法做到,不知道我之前是如何成功做到的。
英文:
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
But now I am unable to do so, don't know how I managed to do so earlier
答案1
得分: 3
运行这个命令:
cd //wsl.localhost/Ubuntu
\\wsl.localhost\Ubuntu
命令不起作用,因为:
-
Bash 在解析命令时会删除反斜杠符号(解决方法:使用正斜杠符号
/
)。 -
您没有指示要更改当前目录,没有这个信息,Bash 会将您的命令解释为运行一个名为该名称的外部程序(解决方法:使用
cd
命令)。
英文:
Run this command:
cd //wsl.localhost/Ubuntu
The command \\wsl.localhost\Ubuntu
didn't work, because
-
Bash removes backslashes while parsing the command (solution: use forward slashes:
/
). -
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).
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论