Skip to content

Some wsl commands

phaledang edited this page Dec 11, 2023 · 3 revisions

Run this command in Powershell which opens the install location of that Windows Store package.

Explorer.exe (Get-AppxPackage Ubuntu).InstallLocation

List the installed distribution to get distribution name

wsl.exe --list --all

Export the required distribution to a tar.gz file:

wsl.exe --export Ubuntu-18.04 D:\MyFolder\MyFile.tar.gz

Import that same file but with different path and different name:

wsl.exe --import MyDistro D:\MyFolder D:\MyFolder\MyFile.tar.gz

Launch the distribution:

wsl.exe --distribution MyDistro

Shutdown everything:

wsl.exe --shutdown

Terminate a specific distro:

wsl.exe -l -v wsl.exe -t <DistroName>

Boot up the default distro (marked with *):

wsl.exe

Boot up a specific distro:

wsl.exe -d

References

https://superuser.com/questions/1443995/how-to-move-ubuntu-on-windows-to-drive-d-or-other-drive

Clone this wiki locally