2019-08-07 13:19:03 -05:00
|
|
|
# wsl
|
|
|
|
|
2023-07-16 19:23:40 +02:00
|
|
|
> Manage the Windows Subsystem for Linux.
|
2022-10-04 20:36:23 +05:30
|
|
|
> More information: <https://learn.microsoft.com/windows/wsl/reference>.
|
2019-08-07 13:19:03 -05: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`
|
|
|
|
|
2021-01-31 14:05:18 -03:00
|
|
|
- Export a distribution to a `.tar` file:
|
2019-08-07 13:19:03 -05:00
|
|
|
|
2023-02-20 17:23:49 +10:00
|
|
|
`wsl --export {{distribution}} {{path\to\distro_file.tar}}`
|
2019-08-07 13:19:03 -05:00
|
|
|
|
2021-01-31 14:05:18 -03:00
|
|
|
- Import a distribution from a `.tar` file:
|
2019-08-07 13:19:03 -05:00
|
|
|
|
2023-02-20 17:23:49 +10:00
|
|
|
`wsl --import {{distribution}} {{path\to\install_location}} {{path/to/distro_file.tar}}`
|
2019-08-07 13:19:03 -05:00
|
|
|
|
2021-10-28 14:17:35 +02:00
|
|
|
- Change the version of wsl used for the specified distribution:
|
2020-10-09 09:00:55 -04:00
|
|
|
|
|
|
|
`wsl --set-version {{distribution}} {{version}}`
|
|
|
|
|
2019-08-07 13:19:03 -05:00
|
|
|
- Shut down Windows Subsystem for Linux:
|
|
|
|
|
|
|
|
`wsl --shutdown`
|