WSL (Windows Subsystem for Linux)

WSL (Windows Subsystem for Linux) :适用于 Linux 的 Windows 子系统。

References

  1. Install WSL with a single command now available in Windows 10 version 2004 and higher | Windows Command Line (microsoft.com)

  2. Install WSL | Microsoft Docs

  3. Best practices for setting up a WSL 2 development environment | Microsoft Docs

  4. Release Notes for WSL kernel | Microsoft Docs

  • WSL 安装与更新:参考 https://docs.microsoft.com/zh-cn/windows/wsl/install-win10

  • 在文件资源管理器中访问 WSL 文件

    • 当我们处于Linux子系统的命令行窗口时,只需输入并执行下面这行命令,我们即可以在Windows文件资源管理器中访问和管理Linux子系统中我们当前所处的文件路径下的文件:explorer.exe .
  • 创建用户名和密码后,此帐户将被视为 Linux 管理员,能够运行 sudo (Super User Do) 管理命令。

  • WSL 切换为管理员身份:su root

  • WSL 查看版本信息:lsb_release -a

  • 更新和升级包:sudo apt update && sudo apt upgrade

  • 在 VS Code 中使用 C++ 和 WSL :参考 Using C++ and WSL in VS Code
    VS Code 中代码格式化方法:

  • VS Code 中设置隐藏文件和文件夹的方法:

原文地址:https://www.cnblogs.com/ltimaginea/p/14018716.html