HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

wsl — Manage the Windows Subsystem for Linux. More information: <https://learn.microsoft.com/windows/wsl/r

Submitted by: @import:tldr-pages··
0
Viewed 0 times
thesubsystemcommandwindowsclimanagewslfor
windows

Problem

How to use the wsl command: Manage the Windows Subsystem for Linux. More information: <https://learn.microsoft.com/windows/wsl/reference>.

Solution

wsl — Manage the Windows Subsystem for Linux. More information: <https://learn.microsoft.com/windows/wsl/reference>.

Start a Linux shell (in the default distribution):
wsl {{shell_command}}


Run a Linux command without using a shell:
wsl {{[-e|--exec]}} {{command}} {{command_arguments}}


Specify a particular distribution:
wsl {{[-d|--distribution]}} {{distribution}} {{shell_command}}


List available distributions:
wsl {{[-l|--list]}}


Export a distribution to a .tar file:
wsl --export {{distribution}} {{path\to\distro_file.tar}}


Import a distribution from a .tar file:
wsl --import {{distribution}} {{path\to\install_location}} {{path\to\distro_file.tar}}


Change the version of wsl used for the specified distribution:
wsl --set-version {{distribution}} {{version}}


Shut down Windows Subsystem for Linux:
wsl --shutdown

Code Snippets

Start a Linux shell (in the default distribution)

wsl {{shell_command}}

Run a Linux command without using a shell

wsl {{[-e|--exec]}} {{command}} {{command_arguments}}

Specify a particular distribution

wsl {{[-d|--distribution]}} {{distribution}} {{shell_command}}

List available distributions

wsl {{[-l|--list]}}

Export a distribution to a `.tar` file

wsl --export {{distribution}} {{path\to\distro_file.tar}}

Context

tldr-pages: windows/wsl

Revisions (0)

No revisions yet.