Comandos wsl
Useful Commands
Update WSL | wsl –update |
Install WSL | wsl –install |
Install a specific Linux Distribution | wsl –install –distribution <Distribution Name> or wsl –install -d <Distribution Name> |
List all available Distribution | wsl –list –online |
List all installed Distributions | wsl –list –verbose |
Set WSL version from 1 to 2 | wsl –set-version <distribution name> <versionNumber> |
Set default WSL version | wsl –set-default-version <Version> |
Set default Linux distribution | wsl –set-default <Distribution Name> |
Change directory to home | wsl ~ |
Run a specific Linux distribution from PowerShell or CMD | wsl –distribution <Distribution Name> –user <User Name> |
Check WSL status | wsl –status |
List of options and commands available with WSL | wsl –help |
Run as a specific user | wsl -u <Username>`, `wsl –user <Username> |
Change the default user for a distribution | <DistributionName> config –default-user <Username> |
To shutdown WSL | wsl –shutdown |
To terminate or stop from running a specific distribution | wsl –terminate <Distribution Name> |
Export a distribution to a TAR file | wsl –export <Distribution Name> <FileName> |
Import a new distribution | wsl –import <Distribution Name> <InstallLocation> <FileName> |
Unregister or uninstall a Linux distribution | wsl –unregister <DistributionName> |
Mount a disk or device | wsl –mount <DiskPath> |