本文简单介绍了 Windows 与 WSL(Windows Subsystem for Linux)之间的互操作。
Run WSL from Windows
- Run Windows Command Prompt(CMD or PowerShell).
Simply add
wslbefore Windows command.1wsl sudo apt updateMix WSL and Windows commands.
1 2wsl ls -la | findstr "foo" dir | wsl grep foo
Run Windows Tools from WSL
- Run Linux Shell(Bash or others).
Simply run windows application with extension
.exe.1notepad.exeMix WSL and Windows commands.
1 2$ ls -la | findstr.exe "foo" $ cmd.exe /c dir | grep foo
