bash - 如何在当前 PowerShell 工作目录中从 PowerShell 进入 Windows-Subsystem-for-Linux (ubuntu)

标签 bash powershell ubuntu windows-subsystem-for-linux

运行命令时bashubuntu在 PowerShell 中,输入了 Windows-Subsystem-for-Linux,但是,PowerShell 的当前工作目录不会传递到 BASH。有没有办法实现这个功能?

最佳答案

在您的 Windows Powershell 或 Powershell Core 窗口中,输入 bash (或wsl);例如:

enter image description here

现在,更高版本的 Windows 包括 WSL.exe,它取代了 bash.exe。这两个可执行文件的行为在我的系统上是相同的。 wsl.exe 的官方文档指出:

enter image description here

您可以阅读该文档 here .网网,

我正在运行 Windows 10 Build-17763。如果您没有遇到与我相同的行为,您可能正在运行旧版本的 WSL。您可以根据内部版本号确定 WSL 的版本。

关于bash - 如何在当前 PowerShell 工作目录中从 PowerShell 进入 Windows-Subsystem-for-Linux (ubuntu),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53832761/

相关文章:

regex - 如何在 bash 中合并两个参数(使用 pcgrep 或其他)

powershell - MicrosoftTeams cmdlet 无法使用 AccessToken

r - 错误 : Bioconductor version '3.13' requires R version '4.1' (R version 4. 0.2)

powershell - 在 ffmpeg 循环命令中出现关键字错误后,缺少开头 '('

powershell - Neo4j(Windows)-无法增加Neo4jImport工具的堆内存大小

linux - 如何在 Ubuntu 上安装 chkconfig?

python - 如何在 Ubuntu 上安装 pgadmin4

linux - centos自动修改权限

linux - Bash 脚本 - 发送电子邮件

linux - Bash 脚本 : Skipping files and grep