Commonly used commands related to WSL2
About 160 wordsLess than 1 minute...
Abstract
This article documents commonly used commands related to WLS2.
Command
View all local subsystems
wsl --list --all
View all online subsystems
wsl --list --online
Install subsystems
wsl --install -d Ubuntu-20.04
Start the specified subsystem
wsl -d Ubuntu-20.04
Force shutdown subsystem
wsl --terminate
Export the specified subsystem
wsl --export Ubuntu-20.04 C:\ubuntu-20.04.tar
Import the specified subsystem and specify the directory and name (can be used to customize the subsystem name)
wsl --import CustomWSLName C:\CustomWSLDir C:\ubuntu-20.04.tar --version 2
Powered by Waline v3.3.0