windows的linux子系统有什么用,在Windows上,Linux的Windows子系统和Ubuntu上的bash有什么区别?...

问题描述

它们的功能有何不同?是其中之一更兼容还是其他?微软为什么要麻烦开发这两个看起来相同的东西?

文件位置。 Windows上的Ubuntu上bash的文件位于C:\Users\\AppData\Local\lxss中,但WSL的文件在哪里?有一个答案声称它们位于C:\Users\\AppData\Local\Lxss\rootfs,但我发现它为空。

WSL是否有”.exe”?对于Windows上的Ubuntu上的bash来说是"C:\Windows\sysnative\bash.exe"。 WSL是否有类似的内容,因此我可以在Visual Studio Code中使用它?

最佳回答

“ Windows上的Ubuntu上的Bash”基于Linux的Windows子系统。 WSL是Windows NT内核上Linux系统调用的实现,它使您可以运行未经修改的Linux可执行文件(就像Wine对于Ubuntu一样)。 “ Windows上的Ubuntu上的Bash”只是WSL的一种应用程序。其他Linux发行版(例如openSUSE或Fedora)是available or will soon be available。

WSL有”exe”。最初是曾经使用过bash.exe,然后是wsl.exe,现在是ubuntu.exe和openSUSE-42.exe。大概fedora.exe将很快出现。从MSDN帖子Manage multiple Linux Distributions in WSL:

There are three ways to launch and run WSL:

wsl.exe or bash.exe

wsl -c [command] or bash -c [command]

[distro], i.e., ubuntu — this is the same as launching the installed app from the Windows menu.

In the first two cases, WSL must pick a distribution to run – a default distribution. If you don’t explicitly set a default, it will be the first one installed.

WSL文件的位置取决于发行版,因为它们是从the store安装的应用程序:

Each distribution you install through the store is installed to that application’s appdata directory. For example: C:\Users\\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState

参考资料

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值