tldr/pages/windows/wsl.md

37 lines
869 B
Markdown
Raw Permalink Normal View History

2019-08-07 19:19:03 +01:00
# wsl
> Manage the Windows Subsystem for Linux from the command-line.
> More information: <https://docs.microsoft.com/windows/wsl/reference>.
2019-08-07 19:19:03 +01:00
- Start a Linux shell (in the default distribution):
`wsl {{shell_command}}`
- Run a Linux command without using a shell:
`wsl --exec {{command}} {{command_arguments}}`
- Specify a particular distribution:
`wsl --distribution {{distribution}} {{shell_command}}`
- List available distributions:
`wsl --list`
- Export a distribution to a `.tar` file:
2019-08-07 19:19:03 +01:00
`wsl --export {{distribution}} {{path/to/distro_fs.tar}}`
- Import a distribution from a `.tar` file:
2019-08-07 19:19:03 +01:00
`wsl --import {{distribution}} {{path/to/install_location}} {{path/to/distro_fs.tar}}`
- Change the version of wsl used for the specified distribution:
2020-10-09 14:00:55 +01:00
`wsl --set-version {{distribution}} {{version}}`
2019-08-07 19:19:03 +01:00
- Shut down Windows Subsystem for Linux:
`wsl --shutdown`