WSL: Basic Commands

WSL Blog

Windows Subsystem for Linux (WSL) is a feature released by Microsoft in 2016 that allows us to install and manage multiple Linux distributions on our local Windows computer with ease.

The latest versions of Windows comes with a set of built-in WSL commands that help us utilise Windows Subsystem for Linux. To install WSL we can simply run ‘wsl --install‘ in our PowerShell terminal, but for more detailed information on this see my page; Installing WSL.

Common WSL Commands

CommandDescription
wslLaunches the default WSL distribution.
wsl -lLists all the installed WSL distributions.
wsl -l -vLists 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 --updateUpdates the specified WSL distribution to the latest version.
wsl -u <distro_name>Upgrades the specified WSL distribution to the latest version.
wsl --installInstalls a new WSL distribution from the Microsoft Store.

For more tips on using WSL and maintaining installed distros, check out the WSL Blog Posts here.


One response to “WSL: Basic Commands”

  1. […] We can list all available WSL Linux Distributions by running wsl -l -o in our Windows Terminal. This is assuming you have WSL installed on your system. You can also check out this page for some information on basic WSL commands. […]

Leave a Reply

Your email address will not be published. Required fields are marked *

Popular Posts

Blog Categories