As I learned PowerShell on Windows, I missed the Linux shell. If you want to play with Linux shell commands on Windows, there is a method called Cygwin (Isn't it still there?), But since it's a good idea, try building a Linux virtual environment on Win with WSL.
The versions of Windows are as follows.
C:\Users\hisabo>systeminfo
hostname: HISABO-PC
OS name: Microsoft Windows 10 Home
OS version: 10.0.18363 N/A build 18363
OS manufacturer: Microsoft Corporation
OS configuration:Standalone workstation
OS build type: Multiprocessor Free
... Below, abbreviated ...
--Build a debian environment with WSL on Windows.
I thought that there was only ubuntu, but since there was debian, I changed it to debian. Certainly the size was 77MB, so there would be no GUI environment. That is more convenient.
When I started debian after installation, I got an error. Refer to the following page and change the Windows settings to enable WSL.
Reference: PC studio (link)
When I started it again, it worked. For the time being, I registered the user (user name, password) and the shell started up. It's a wonderful CUI.
For the time being, update the package.
hisabo@hisabo-PC:~$ sudo apt-get update
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
[sudo] password for hisabo:
Get:1 http://deb.debian.org/debian buster InRelease [121 kB]
Get:2 http://security.debian.org/debian-security buster/updates InRelease [65.4 kB]
Get:3 http://deb.debian.org/debian buster-updates InRelease [49.3 kB]
(Omitted)
Get:12 http://deb.debian.org/debian buster-updates/main Translation-en [5,166 B]
Fetched 15.0 MB in 40s (380 kB/s)
Reading package lists... Done
hisabo@hisabo-PC:~$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
apt apt-utils base-files cron e2fsprogs gpgv iputils-ping libapt-inst2.0 libapt-pkg5.0 libbz2-1.0 libcom-err2
libcryptsetup12 libdns-export1104 libext2fs2 libgnutls30 libidn2-0 libisc-export1100 libncurses6 libncursesw6 libss2
libssl1.1 libsystemd0 libtinfo6 libudev1 ncurses-base ncurses-bin sudo systemd systemd-sysv tzdata udev
31 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 17.2 MB of archives.
After this operation, 10.2 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://deb.debian.org/debian buster/main amd64 base-files amd64 10.3+deb10u4 [69.8 kB]
(Omitted)
hisabo@hisabo-PC:~$
hisabo@hisabo-PC:/etc$ echo $SHELL
/bin/bash
It's bash.
Just in case, check the login shell in / etc / passwd. It's bash.
Check the input method with vi (vim). I tried as long as I remember how to change to Japanese input mode, but none of them hit. At the very end, when I pressed the half-width / full-width key, I was able to input Japanese smoothly. I saved it and checked it with cat, more, less, and view, but I can see Japanese even when browsing. At first glance, there seems to be no problem.
hisabo@hisabo-PC:/etc$ echo $LANG
en_US.UTF-8
hisabo@hisabo-PC:/etc$ locale
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
hisabo@hisabo-PC:/etc$ locale -a
C
C.UTF-8
en_US.utf8
POSIX
hisabo@hisabo-PC:/etc$
After all it is UTF-8. Isn't there euc at this time? I noticed that it's not ja_JP.UTF-8, right? Well, let's find out later.
I typed a command to try using awk, but I forgot because I haven't used it for a long time. I tried to find out with man, but man doesn't seem to be installed by default. install.
hisabo@hisabo-PC:/etc$ sudo apt-get install man
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'man-db' instead of 'man'
The following additional packages will be installed:
groff-base libgdbm6 libpipeline1 libuchardet0
Suggested packages:
groff apparmor www-browser
The following NEW packages will be installed:
groff-base libgdbm6 libpipeline1 libuchardet0 man-db
0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 2,351 kB of archives.
After this operation, 6,820 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
In the days when Google wasn't there, I used man to find out how to use commands. It's a good time now. There are most answers on the net.
--How to build a debian environment on Windows 10 with WSL
Recommended Posts