Lesson 03: Windows Setup

GET THE FULL COURSE HERE

Installing Ubuntu

Be sure to understand the difference between the PowerShell prompt and the Ubuntu Terminal.

On Windows, be sure not to confuse the Powershell prompt with the Unix terminal. To install WSL (or the Unix terminal), we will use the PowerShell prompt, so let’s start with that.

You get to the PowerShell prompt by right-clicking on the desktop -> and then choosing Open Terminal.

In Windows, you

This is the standard way you refer to folders and files in UNIX: The slashes separate folder from each other or, for the final slash, it separates the folder containing the file from the file name. Slahes denote the file hierarchy — a directed tree structure where each folder can contain any number of other folders or files. It is called a “directed” tree because it has one direction: from the root of the hard drive down (or up, depending on your perspective) into the folders and files on the system.

Install WSL

Set WSL 2 as Default (Optional): If you want to use WSL 2 by default, run the following command in PowerShell:

(Remember, you can tell youare in the Powershell because the terminal line looks something like C:\...\...)

Type

wsl --set-default-version 2

Now run the WSL install using:

wsl --install

This is actually all you need to do to install Ubuntu. What is Ubuntu? Ubuntu is a Linux distribution. In other words, a flavor of Linux.

Working with Ubuntu

Once you have installed WSL and Ubuntu by running the command above, you’ll open Ubuntu by searching for it from the search bar:

Windows 10 vs Windows 11

Windows 10
Windows 11

While you’re in Windows Subsystem for Linux, you are using a UNIX-based subsystem, and therefore, the terminal inside of WSL is a UNIX-based terminal.

While you’re in Windows Subsystem for Linux, you are using a UNIX-based subsystem; therefore, the terminal inside WSL is a UNIX-based terminal. Remember, the slashes in your directory structure no longer have backslashes but instead use forward slashes.

The first thing to do is find out where we are, which you won’t even learn until the next lesson.

Type the letters pwd and hit return. pwd is our very first Unix command! It stands for print working directory, and it does just that: prints (displays to the screen) the working directory we are in.

The terminal responds with something like:

~~~~~~~

This tells you “where you are” in your hard drive. This is the specific folder where your Terminal prompt will use as the directory for any further Unix commands. Specifically, this is referred to as the working directory.

The working directory is the point where you are currently browsing, right there in this terminal session. It is unique to this terminal session. If you start a new terminal window (for example, in another tab or another window), that terminal session will have its own working directory.

We will soon learn how to navigate around the working directory.

Update Packages

Next, let’s update our packages using a program called apt

Remember, you get here by searching for “Ubuntu” in the applications bar and opening the Unix terminal:

sudo apt update 
sudo apt upgrade

This will update and upgrade our installed packages. This is a common thing to do after first setting up a system on any Unix platform.

Keystroke Modifier Keys (C- and M-)

Most all Unix keystrokes come in either or a combination of C- (for control key) and M- for meta. When you read Unix documentation, you’ll see markers like these to indicate keystrokes you should type on your keyboard to activate that function. (The other modifier keys on your keyboard– function, Option on Mac, Windows key on a Windows keyboard, etc, are sometimes used, but it is less rare. The historical Unix systems generally used C- and M- keystrokes only because those are mapped to work the same way on different operating systems.)

Control Key — On Windows, the control key is marked Control or Ctrl

Meta Key — On Windows, the Alt Key is used as the Meta key by default. It is marked as the Alt key.

Remember, you typically press the modifier keystroke along with another key on the keyboard. A good fingering technique is to train your hand to follow the muscle memory of pressing the modifier key first, then stroking the key itself, just as you do for common computer operations like copy, cut, & paste. Notice that those operations use the Windows key, also known as the “Command” key. Those two modifier keys are typically not used by Unix/Linux programs, because they are considered “system dependent.” Get familiar with keystroking the Control key ( Ctrl) and Meta (Alt) keys just like you do with modifier keys you already know.

Once you are comfortable with keystroking, let’s put them to use. For that, turn to Lesson 4, where we will learn to navigate around your Terminal window.

GET THE FULL COURSE HERE