Front end development plays with win10 linux subsystem

Preface

The latest version of win10 has been added with linux subsystem function. After a week's development, I feel that I can completely replace Mac OS. In linux environment, the ease of use of terminal tools, environmental stability and win10's massive software are combined, and then look at the wide choice of PC, it's not too good. It's time to give up osx and choose win10 as a web developer to produce Force tool platform.

Reference resources

Dev on Windows with WSL

windows 10 linux subsystem oh-my-zsh and Cmder configuration-2018

Open win10 linux function

Step 1: open programs and functions

Step 2: check the linux function and confirm

Install linux distribution

  1. Open win10 store
  2. Search linux keywords
  3. Installing Ubuntu 18
  4. Open Ubuntu 18 app Icon
  5. Operate powershell to enable the function in administrator mode after accessing the web address according to the terminal prompt
  6. Open ubuntu again and wait a few minutes for installation

ubuntu switch to Ali source

\cp -f /etc/apt/sources.list /etc/apt/sources.list_bak_`date +"%Y_%m_%d_%H_%M_%S"`;
echo 'deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse' >/etc/apt/sources.list;

apt-get update

apt-get upgrade

Install nodejs

sudo su
apt update
apt install nodejs
node -v
apt install npm
npm i -g n
n lts

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 -)"

Modify zsh theme

vim ~/.zshrc

ZSH_THEME="agnoster"

Start bash and enter zsh by default

vim ~/.bashrc

if test -t 1; then
    exec zsh
fi

Terminal font completion

sudo apt-get install fonts-powerline

VSCode configuration

{
    "terminal.integrated.shell.windows": "C:\\Windows\\sysnative\\bash.exe",
    "terminal.external.windowsExec": "C:\\Windows\\sysnative\\bash.exe" 
}

PS: I'll fill in the relevant figures later. The above tutorial has met the requirements of getting started.

Keywords: Linux Ubuntu Windows sudo

Added by AshrakTheWhite on Sat, 09 Nov 2019 00:30:23 +0200