Not envy mandarin duck not envy fairy, a line of code half a day. Xjjdog (xjjdog)

Linux is high on the list of programmers, but if you install a graphical interface, you lose points. After all, you need a mouse! A programmer’s desktop should not be cooler than anyone else’s, or have more screens and less color on the desktop.

Windows never had this aperture because it was aimed at idiots. Of course, its CMD is tech from start to finish, always in black and white.

Microsoft is finally going to have to take care of distressed developers in recent years. Two viable products, one is vscode and the other is Windows Terminal.

Why is the terminal so important? For a programmer, losing the command line is like losing half an arm. Whether this arm is beautiful or not depends on the command line terminal.

So much so that Microsoft employees, for a long time in the company, cuddled a Mac, which was quite humiliating.

Now, finally, there’s nothing to worry about. Windows and Linux are finally converging. You can play games and happily write commands on the same system, and there are tons of Linux tools to support it.

Install Windows Terminal

I usually use Xshell when remotely connecting to other Linuxes, just because it looks pretty.

On Windows, you can install Windows Terminal. Somewhat similar to iTerm on MacOS, it is arguably the most comfortable terminal on Windows.

The installationWindows TerminalYou need to get it from the app store, which is the button down here.

Search Windows Terminal in the search box to find the software. On a more personal note, it doesn’t require you to prepare an account, as the Mac app Store does. WT does not require login to obtain.

It doesn’t matter if your page keeps spinning, just close and reopen it a few times. For well-known reasons, there are few foreign websites that do not circle.

Installing the Ubuntu subsystem

At this point, we have just installed a command-line terminal, which is one step away from our goal of throwing Linux away. Don’t worry, here’s how to install Ubuntu on Windows.

Solution 1: Install Linux on a VM and access it on a terminal? . This is a low-grade solution, the way I’ve always done it in the past, full of frustrations.

Plan 2: Install Linux on a partition and switch on reboot. Just kidding, this approach is more backward, the product of antique level players.

All you need to do is turn on the subsystem on your system and install Linux in the App store.

How easy is it? It’s so simple that you may not spend as much time as I spend talking about it.

In the control panel, go to program options and click “Enable or disable Windows features”.

From the dialog box that pops up, click to the bottom and check “Windows subsystem for Linux”. Done!

Install Ubuntu from the App Store and the system will exist as software. I chose the LTS version here, and I can see that there are not many people who rate it, probably most of them are tourists like me who don’t have Microsoft accounts.

After the configuration

And then something amazing happened. In the upper right corner of our Windows Terminal, there is a down arrow that you can click to see the newly installed Ubuntu.

On Windows, it’s one click away from Linux.

Once in Linux, we can configure the machine as if it were a normal Linux system.

First, change the Ubuntu software source. Edit the /etc/apt/sources.list file and change its contents to the source below.

deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
Copy the code

Then, install the best oH-my-zsh. Install the shell terminal with sudo apt install ZSH, then run the following command.

sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Copy the code

After a short period of time, our terminal appearance level gets even higher.

If you want to make your terminal more beautiful, refer to the theme page below. After all, command terminals are something you face every day, longer than you face your girlfriend, and being ugly is bad for your mood.

https://terminalsplash.com/
Copy the code

One last question. How do we access files in Linux on Windows?

This is a little bit magical. Run the following command on Linux.

cd /home
explorer.exe .
Copy the code

The command above opens the Linux directory corresponding to the Windows directory, which can be accessed from the file manager.

I’ve mapped this long directory to disk Z for ease of operation. As shown in figure, next time when accessing Linux, directly access Z disk can be.

End

As you can see, we’ve lost our footing in introducing some of the previous nouns. Sometimes it’s Ubuntu, sometimes It’s Linux, sometimes it’s subsystems.

There are two reasons for this. One reason is that the first time I used it, I was so excited that I couldn’t speak coherently. Another reason is that my system is so different now that Windows and Linux are so deeply integrated that they don’t share you or me, and even the network doesn’t share NAT bridging.

For example, when I run cmd.exe on Linux, I enter the Windows command line terminal, so that my mind is now clouded.

I ditched Windows, ditched Linux, and chose the MacBook because it had beautiful graphics terminals and good command lines, and now Windows has them too.

Why would I stick with my MackBook? Maybe it’s because it’s more expensive and looks good in the coffee shop.

Little Sister Flavor (XjjDog), a GZH that doesn’t allow programmers to get sidetracked. Focus on infrastructure and Linux. Ten years architecture, ten billion daily flow, and you discuss the world of high concurrency, give you a different taste.