如何从Powershell核心访问WSL PATH?



如果我打开 Ubuntu 应用程序(终端(并键入echo $PATH,我会得到一堆目录。如果我在Powershell核心中键入wsl echo $PATH,我什么也得不到(空白行(。我想从Powershell核心运行Linux命令,我该怎么做?

那是因为当你运行wsl <command>.bashrc没有运行,你需要运行wsl bash -c '<command>',或者在bash shell内运行<command>

最新更新