WSL
Mar 30th, 2020 - Now
Basic Operation
Build a wsl
在微软商店中直接安装即可。
以下的操作以 Ubuntu-18.04 为例,可以通过 wsl -l
查看自己安装的WSL。
Run a wsl
wsl --distribution Ubuntu-18.04-20190707
or
wsl -d Ubuntu-18.04-20190707
Remove a wsl
wsl --unregister Ubuntu-18.04-20190707
Terminate a wsl
wsl -t Ubuntu-18.04-20190707
or
wsl --terminate Ubuntu-18.04-20190707
Back up a wsl
wsl -t Ubuntu-18.04-20190707 // 必须先停止要备份的WSL
wsl --export Ubuntu-18.04-20190707 path/to/your/backup
Recover a wsl
wsl --import Ubuntu-18.04-20190707 path/to/your/wsl/location path/to/your/backup
注意这里有两个地址的参数,第一个是定义安装WSL在哪里,第二个是WSL的备份在哪里,可以通过删除再重新定义存放WSL的路径的方式来减少WSL对C盘的占用。
Reference
Last updated
Was this helpful?