Learning the UNIX command line is an important skill for programmers and data researchers of all kinds, but if you are a Windows user, using the command line skills on your computer means you will need to install Linux on Windows. In this guide, we will introduce you to set up the Windows subsystem for Linux on your Windows computer so that you can fully utilize your UNIX command-line skills.
(In Data-quest, we have released an interactive course on using the command line, as well as an interactive course on word processing using the command line. Users of any system will be able to practice on our interactive web platform. However, if you want to practice these command-line skills on your own computer and when using Windows, you will need to do a little setup before you can access the UNIX command line since Windows is not based on Unix.)
In this guide, we will install the Windows subsystem for Linux (WSL) and the Linux distribution for working with WSL, which allows you to use the UNIX command-line interface.
Installing WSL is quite simple, but not possible on every version of Windows, so first of all, make sure your computer is compatible.
Step 1: ensuring compatibility
To install WSL, a 64-bit version of Windows 10 version 1607 (or higher) must be installed on your computer. If you don’t know what version you have, go to “Settings”> “System”> “About” and find the “Version” and “System Type” fields.
Compatibility system registration
If you have 64-bit Windows 10, but your version is lower than 1607, you will have to update Windows before proceeding with the installation. To update Windows, follow these instructions.
If you don’t have a 64-bit architecture or if you have an earlier version of Windows, you won’t be able to start WSL. But don’t worry! You can still use the UNIX command line on your computer by installing Cygwin. You can find Cygwin installation instructions here. If your machine supports it, it is best to install WSL, so let’s move on to the next step!
Step 2. Enable the optional WSL component
The Windows subsystem for Linux is a built-in feature of Windows 10, but you must enable it manually. Since it is disabled by default, the first thing we need to do is enable it.
To do this, go to Control Panel> Programs> Turn Windows Features On or Off, and then scroll down in the pop-up window until the Windows Subsystem for Linux appears. We will check the box next to this and then click “OK” to enable this feature. Then, after a short progress bar, while Windows searches for files and applies the changes, we will be asked to restart the computer for the changes to take effect.
For a small reduction, we can also simply search for “turn w” in the Windows 10 search bar. By clicking on the top result of this search, you will be taken directly to Control Panel> Programs> Turn Windows components on or off, after which we can perform the same actions. which are described above to enable the Windows subsystem for Linux.
Remember that before proceeding to the next step, we must restart the computer for the changes to take effect.
Step 3: Install Linux on Windows
After rebooting the computer, our next step is to install the Linux distribution. We will open the Microsoft Store – look for the “Microsoft Store” in the Windows search bar or go to it in the “Start” menu.
For the purposes of this guide, we will choose Ubuntu, but the installation process for any other Linux distribution will be the same. On the Ubuntu page, click Get, and then select No, Thanks in the pop-up message. Ubuntu will start the download automatically, and when it is completed, the Launch button will appear.
Step 4: Launch and create your account
After the download of the Ubuntu application is complete, click “Run” and wait for it to install. It will open a new window and we will find out that it completed the installation when we are prompted to create a user account.
When you’re done, enter your preferred username and password. It could be anything; it does not have to match your username or password for Windows. Please note that you will be prompted to enter the password twice and that when entering the password will not be displayed on the screen.