加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

在Windows上的特定或当前文件夹中启动WSL Ubuntu

发布时间:2020-12-14 01:50:58 所属栏目:Windows 来源:网络整理
导读:当从他的开发机器上的商店安装Subsystem for Linux和Ubuntu时,我可以简单地切换(或启动)到Ubuntu shell 但默认情况下,Ubuntu shell在/ home / techsupp文件夹中启动.是否可以强制它在与我使用Ubuntu命令的文件夹相同的文件夹中启动? 所以在我的例子中,我应
当从他的开发机器上的商店安装Subsystem for Linux和Ubuntu时,我可以简单地切换(或启动)到Ubuntu shell

enter image description here

但默认情况下,Ubuntu shell在/ home / techsupp文件夹中启动.是否可以强制它在与我使用Ubuntu命令的文件夹相同的文件夹中启动?

所以在我的例子中,我应该进入

/mnt/h

谢谢.

我已经尝试过的:

H:&;ubuntu help
Launches or configures a linux distribution.

Usage:
    <no args>
      - Launches the distro's default behavior. By default,this launches your default shell.

    run <command line>
      - Run the given command line in that distro,using the default configuration.
      - Everything after `run ` is passed to the linux LaunchProcess call.

    config [setting [value]]
      - Configure certain settings for this distro.
      - Settings are any of the following (by default)
        - `--default-user <username>`: Set the default user for this distro to <username>

    clean
      - Uninstalls the distro. The appx remains on your machine. This can be
        useful for "factory resetting" your instance. This removes the linux
        filesystem from the disk,but not the app from your PC,so you don't
        need to redownload the entire tar.gz again.

    help
      - Print this usage message.

我也在uservoice:https://wpdev.uservoice.com/forums/266908-command-prompt-console-windows-subsystem-for-l/suggestions/13421103-let-us-right-click-open-bash-here-from-explorer?tracking_code=8a8bc624c72a8336565fcd6d5737d712上发现了这个请求

请投票支持.

解决方法

如果使用wsl.exe,它将在当前目录中启动WSL.但是wsl和ubuntu之间的区别在于,如果你安装了两个或更多的发行版(例如,Ubuntu和Fedora),默认的就会开始.您可以通过运行wslconfig / setdefault Ubuntu将默认值设置为Ubuntu.

参考:[1] https://docs.microsoft.com/en-us/windows/wsl/wsl-config

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读