在 Windows 10 上的 Ubuntu 上使用 Cmder 和 Bash
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/39882404/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Use Cmder with Bash on Ubuntu on Windows 10
提问by neiya
I am new to bash and commandline, a friend adviced me to use Bash with Cmder so I downloaded it here : http://cmder.net/(mini)
我是 bash 和命令行的新手,一位朋友建议我将 Bash 与 Cmder 一起使用,所以我在这里下载了它:http://cmder.net/ (mini)
The problem is, that when I open it it emulates the standard command prompt and not Bash. I can't find where I can configure it.
问题是,当我打开它时,它会模拟标准命令提示符而不是 Bash。我找不到可以配置的地方。
When I say Bash I mean Bash on Ubuntu on Windows 10.
当我说 Bash 时,我指的是 Windows 10 上的 Ubuntu 上的 Bash。
采纳答案by Alec Istomin
The Windows bash.exe is located in C:\Windows\System32, all you need to do from cmder shell is to use the full path:
Windows bash.exe 位于 C:\Windows\System32,你需要从 cmder shell 做的就是使用完整路径:
C:\Windows\System32\bash
回答by Seanny_Crow
Here's how I did it:
这是我如何做到的:
in Settings, Tasks I added a "bash::ubuntu" task which I launch with :
在设置,任务中,我添加了一个“bash::ubuntu”任务,我用它启动:
%windir%\system32\bash.exe -cur_console:pm:/mnt
%windir%\system32\bash.exe -cur_console:pm:/mnt
(paste it in the big box in the lower right corner)
(粘贴在右下角的大框中)
I even set up its icon with :
我什至设置了它的图标:
-icon "%USERPROFILE%\AppData\Local\lxss\bash.ico"
-icon "%USERPROFILE%\AppData\Local\lxss\bash.ico"
(paste it in "Task parameter".)
(将其粘贴到“任务参数”中。)
And it works like a charm, I even set up a personnalised palette locked to bash::ubuntu (using Ap Distinct) that looks like the purple terminal from ubuntu.
它就像一个魅力,我什至设置了一个锁定到 bash::ubuntu(使用 Ap Distinct)的个性化调色板,看起来像 ubuntu 的紫色终端。
BTW the latest version of ConEmu has already bash.exe setup under Bash::bash.
顺便说一句,最新版本的 ConEmu 已经在 Bash::bash 下设置了 bash.exe。
回答by Shihe Zhang
Support for the new Windows 10 bash shellis a closed issue now.
Settingcould be done this way:
对新的 Windows 10 bash shell 的支持现在是一个封闭的问题。
设置可以这样完成:
You make a new task called Bash::Ubuntu
Task parameters:
/icon "%USERPROFILE%\AppData\Local\lxss\bash.ico"
Commands:
cmd /k "%SYSTEMROOT%\System32\bash.exe" -new_console:d:%USERPROFILE%
Then you make a new task called Bash::Ubuntu as Admin
Task parameters same as before Commands:
*cmd /k "%SYSTEMROOT%\System32\bash.exe" -new_console:d:%USERPROFILE%
您创建了一个名为 Bash::Ubuntu 的新任务
任务参数:
/icon "%USERPROFILE%\AppData\Local\lxss\bash.ico"
命令:
cmd /k "%SYSTEMROOT%\System32\bash.exe" -new_console:d:%USERPROFILE%
然后你以管理员身份创建一个名为 Bash::Ubuntu 的新任务
任务参数与之前命令相同:
*cmd /k "%SYSTEMROOT%\System32\bash.exe" -new_console:d:%USERPROFILE%
2018/7/2 no extra setting need with the latest version of Cmder(v1.3.6)
and Win10(17134)
with WSL(Windows subsystem Linux)
.
2018年7月2日没有额外的设置需要与最新版本Cmder(v1.3.6)
,并Win10(17134)
用WSL(Windows subsystem Linux)
。
回答by Oleg Pro
You can type bash
in your terminal to switch to the bash mode
您可以bash
在终端中输入以切换到 bash 模式
exit
to exit
exit
退出
same sh
for shell
sh
外壳相同