This is a basic guide to installing the Ubuntu command line on Windows using WSL, the Windows Subsystem for Linux. This guide is neither unique nor exhaustive: I've just given these instructions to enough people that I thought I'd put it up online.
Ensure you're compatible
Your computer needs to be running Windows 10 version 1709 or higher. You can check this in system settings:
Press Windows Key -> Search "About your PC" -> Scroll to the bottom -> Make sure the Edition is some form of Windows 10 other than Windows 10 S, make sure the Version is at least 1709
If the version number is lower than 1709, you don't have the Fall Creators Update. You can head over to Microsoft's site to get it.
You need to manually enable the Windows Subsystem for Linux:
Press Windows Key -> Search "Turn Windows features on or off" -> Scroll to the bottom -> Check the box for Windows Subsystem for Linux -> Restart your computer
The restart may take several minutes, since your computer is enabling WSL. After this first time, restarts and the like won't take any longer than usual.
Now that WSL is enabled, you need to install a form of Linux that uses it. Ubuntu is a good default and is suitable for almost anything you'd want to do. You can get it by clicking this link on your computer or by doing the following:
Press Windows Key -> Search "Microsoft Store" -> Use the search bar in the top right to search "Ubuntu" -> Install the Ubuntu app
Once the app is downloaded, set it up by launching it. The store page you installed it from will have a button to launch it, or you can search for it:
Press Windows Key -> Search "Ubuntu"
Ubuntu may take several minutes to load. Eventually, it will ask you to create a username and password. They can be whatever you like, but make sure you keep track of them. Note that when entering the password, the characters won't show up: the computer is registering them perfectly fine, it just doesn't show the password while you're typing it.
Once that is finished, you're done with the installation! The next part assumes you've closed Ubuntu's window.
Entering and Exiting
The easiest way to access the Ubuntu command line in my experience is to launch it from the Windows command line:
Press Windows Key -> Search "cmd" -> Enter the following command:
You'll see the username you created when you set up Ubuntu, and you're at the Ubuntu command line. To exit the Ubuntu command line you can close the window or use the following command to return to the Windows command line:
You don't have to write the dollar sign before the command—the dollar sign is often used to denote that the command should be entered while you're in the Ubuntu command line.
Installing Miscellaneous Packages
What's below may or may not apply to you: when I help someone install something into Ubuntu on WSL, I put the instructions below. Ubuntu on WSL behaves almost exactly like a normal Ubuntu command line, so any instructions you find for the latter will almost certainly work for the former.
Pip and PyCrypto
Pip and Pycrypto are recommended for students taking CS 2550 Foundations of Cybersecurity at Northeastern University. Note that the following instructions assume you're using Python 2.x, which is what comes pre-installed on WSL Ubuntu as of this writing. If you have manually upgraded to Python 3.x, replace "python-pip" with "python3-pip" in the first command. These commands will also ask for your password: the password they're looking for is the one you created when you set up Ubuntu.
On the Linux command prompt, enter the following three commands in order:
$ sudo apt-get install python-pip $ sudo apt-get update $ sudo pip install pycrypto
Racket is in the command line is recommended for students taking CS 2550 Fundamentals of Computer Science I at Northeastern University. To install Racket, enter the following commands on your Linux command prompt:
$ sudo add-apt-repository ppa:plt/racket $ sudo apt-get update $ sudo apt install racket
You can test that Racket is installed by entering the following:
$ racket -v