如果我打开 Ubuntu 应用程序(终端(并键入echo $PATH
,我会得到一堆目录。如果我在Powershell核心中键入wsl echo $PATH
,我什么也得不到(空白行(。我想从Powershell核心运行Linux命令,我该怎么做?
那是因为当你运行wsl <command>
时.bashrc
没有运行,你需要运行wsl bash -c '<command>'
,或者在bash shell内运行<command>
。