- Command prompt commands basic install#
- Command prompt commands basic update#
- Command prompt commands basic windows#
Change the default user for a distribution config -default-user Ĭhange the default user for your distribution log-in. To run WSL as a specified user, replace with the name of a user that exists in the WSL distribution. Run as a specific user wsl -u `, `wsl -user
See a list of options and commands available with WSL. See general information about your WSL configuration, such as default distribution type, default distribution, and kernel version. You can also use the command: wsl -update rollback to rollback to a previous version of the WSL Linux kernel.
Command prompt commands basic update#
Manually update the version of your WSL Linux kernel. To print the current user name, use the command whoami. If the user doesn't exist in the WSL distribution, you will receive an error. Debian) and with the name of an existing user (ie. To run a specific Linux distribution with a specific user, replace with the name of your preferred Linux distribution (ie. Run a specific Linux distribution from PowerShell or CMD wsl -distribution -user To jump from any directory back to home from within a WSL command prompt, you can use the command: cd ~. The ~ can be used with wsl to start in the user's home directory. To set the default Linux distribution that WSL commands will use to run, replace with the name of your preferred Linux distribution. Set default Linux distribution wsl -set-default To set a default version of WSL 1 or WSL 2, replacing with either the number 1 or 2 to represent which version of WSL you would like the installation to default on for new Linux distribution installations. Set default WSL version wsl -set-default-version To designate the version of WSL (1 or 2) that a Linux distribution is running on, replace with the name of the distribution and replace with 1 or 2. Set WSL version to 1 or 2 wsl -set-version Additional options that can be used with the list command include: -all to list all distributions, -running to list only distributions that are currently running, or -quiet to only show distribution names. This command can also be entered as: wsl -l -v.
Command prompt commands basic windows#
See a list of the Linux distributions installed on your Windows machine, including the state (whether the distribution is running or stopped) and the version of WSL running the distribution (WSL 1 or WSL 2). List installed Linux distributions wsl -list -verbose This command can also be entered as: wsl -l -o. See a list of the Linux distributions available through the online store. List available Linux distributions wsl -list -online This command can also be entered as: wsl -d.
Command prompt commands basic install#
Install a specific Linux distribution wsl -install -distribution ĭesignate a distribution of Linux for installation besides the default (Ubuntu) by replacing with the name of the distribution. Install WSL and the Ubuntu distribution of Linux. To run these commands from a Bash / Linux distribution command line, you must replace wsl with wsl.exe. The WSL commands below are listed in a format supported by PowerShell or Windows Command Prompt.