Here is a list of some of the most common WSL commands:
wsl
: This command will start a new WSL sessionwsl -l
: This command will list all of the installed WSL distributionswsl --list --online
: This command will list all of the available WSL distributionswsl --list --running
: This command will list all of the running WSL distributionswsl -d <distribution name>
: This command will run the specified distributionwsl --install <distribution name>
: This command will install the specified distributionwsl --unregister <distribution name>
: This command will remove the specified distribution to free up the disk spacewsl --shutdown
: This command will shut down all running WSL sessionswsl --terminate <distribution name>
: This command will terminate the WSL session for the specified distributionwsl --set-version <version number>
: This command will set the default WSL versionwsl --status
: This command will display the status of all running WSL sessionswsl --import <distribution name> <tarball path>
: This command will import a new WSL distribution from a tarball filewsl --mount <source path> <source path>
: This command will mount a Windows file system path to a WSL mount pointwsl --unmount <mount point>
: This command will unmount a WSL mount pointwsl --default <distribution name>
: This command will set the default WSL distribution
In WSL, your Windows drives are mounted under the /mnt
directory. So, for example, your C drive would be available at /mnt/c/
. cd /mnt/c/Users/<YourWindowsUsername>/
For WSL 2, you can access the Linux file system by navigating to \\wsl$\<DistributionName>
in File Explorer.
WSL configurations can be modified by editing the file: C:\Users\<YourWindowsUsername>\.wslconfig
.