Directory navigation
(1) Install WSL
-
Open the subsystem support
1.win + x, select Windows PowerShell (administrator)
2. Enter:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
3. Enter, enter Y, restart. -
Download and run the subsystem
1. Open the application store, search for "Linux", install your favorite version, the author uses Ubuntu
(no Microsoft account, follow the prompts to register and log in)
2. Run after the installation is complete, the installation prompts to customize the user name and password.
(2) VScode configuration
- Set the default to use the WSL terminal
. Add this sentence in the VSCode settings file
"terminal.integrated.shell.windows": "C:\\\\Windows\\\\System32\\\\wsl.exe",
- Installed plugins
(3) Terminal configuration and beautification
- Download and install Cmder https://cmder.net/
as shown above, add a task in tasks
1. The name is Ubuntu, the name is whatever you want
2. Inside the big box below set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & %ConEmuBaseDirShort%\conemu-cyg-64.exe --wsl --distro-guid={54d1c74b-1774-457f-b68f-82aae05350c3} -cur_console:pm:/mnt
. This 54d1c74b-1774-457f-b68f-82aae05350c3
refers to the unique identifier of Ubuntu. If the subsystem is reinstalled, this identifier will change accordingly. You can find it in the registry (regedit) 计算机\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss
. win+R搜索regedit
.
The basic configuration has been completed here. Friends who want to use powerful zsh can continue to configure and beautify the terminal.
- Install oh-my-zsh
Use command line in Ubuntu system instead of win
Be sure to update before installing any packages! sudo apt-get update
Install zsh sudo apt-get install zsh
Install oh-my-zsh sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
Successful installation
- Beautify and optimize
1. Change theme
If you are using it vim ~/.bashrc
, use :wq
exit after editing .
If you are using it nano ~/.bashrc
, Ctrl+Shift+X
save and exit.
Modify the theme:
vim ~/.zshrc
# 主题名字ys,你可以搜索其他的主题使用
ZSH_THEME="ys"
Save after modification.
2. To explain the requirements of oh-my-zsh third-party plug-ins.
(4) Directory management
- window to access the Linux directory
win + R, enter\\wsl$
- Enter the window directory under the Linux terminal
For example: enter the C drivecd /mnt/c
- It is more convenient if the right button of cmder is configured
- Configure the right-click menu: Administrator runs cmd (note that it is
cmd
not Cmder), enter the path where Cmder.exe is located, and run the command:
Cmder.exe /REGISTER ALL
(5) Small trial cattle knife
(6) Reference materials
https://docs.microsoft.com/en-us/windows/wsl/install-win10
https://www.jianshu.com/p/f4d046fea5db
https://blog.joaograssi.com/windows-subsystem-for-linux-with-oh-my-zsh-conemu/