WSL: Basic Commands
Windows Subsystem for Linux (WSL) is a feature that allows users to run Linux distributions on a Windows computer. WSL comes with a set of commands that can be used to manage and interact with the Linux distributions installed on your system.
On this page, we’ll provide a table of common WSL commands and their descriptions to help you get started with using the Windows Linux Subsystem.
Command | Description |
---|---|
wsl | Launches the default WSL distribution. |
wsl -l | Lists all the installed WSL distributions. |
wsl -l -v | Lists all the installed WSL distributions and their versions. |
wsl -s <distro_name> | Sets the specified distribution as the default WSL distro. |
wsl --set-default <distro_name> | Sets the specified distribution as the default WSL distro. |
wsl --set-version <distro_name> <version> | Changes the WSL version of the specified distribution. |
wsl --unregister <distro_name> | Uninstalls the specified WSL distribution. |
wsl --export <distro_name> <file> | Exports the specified WSL distribution to a tar file. |
wsl --import <distro_name> <install_location> <file> | Imports a tar file into a new WSL distribution. |
wsl --terminate <distro_name> | Terminates the specified WSL distribution. |
wsl --update | Updates the specified WSL distribution to the latest version. |
wsl -u <distro_name> | Upgrades the specified WSL distribution to the latest version. |
wsl --install | Installs a new WSL distribution from the Microsoft Store. |