我正在写一个Dockerfile我正在使用选项卡(我通常在任何地方都使用)进行格式化的文件。
但是我复制了一个多行命令,其中第二行以两个制表符开头,即:
apt-get -y update && \
apt-get -y install collectd \ # begin two tabs
Run Code Online (Sandbox Code Playgroud)
第一行正确执行,但第二行尝试“自动完成”,显示所有可能的命令,然后:
> stall collectd
# [ apt-get updating ]
bash: stall: command not found
Run Code Online (Sandbox Code Playgroud)
我了解“自动完成”行为,但是stall collectd?为什么 Bash 会吃掉这apt-get -y in部分?
You can check which version is each installed distribution with the command,
wsl -l -v
Run Code Online (Sandbox Code Playgroud)
as this superuser question states.
But is it possible to know the WSL version (1 or 2) from inside the Linux installation?
Is there any reliable mechanism to check the version?
The only difference in environment variables, is that WSL 2 has one named WSL_INTEROP that version 1 has not.
That variable points to a path special file. …