Skip to content

Learn Linux from scratch: terminal and SSH

Almost every server in the world runs Linux, and almost none of them has a screen. There’s no desktop, no windows and no mouse: only a TerminalAn application where you give the computer instructions by typing text instead of clicking. Almost every server is managed this way.Go to definition where you type commands and read responses. In Phase 0 you saw where data travels. In this phase you’ll learn to find your way around the place where backend code lives.

You won’t write any code yet. You’ll learn to use a computer with text alone, which is how you work on a server, and to get into one that’s far away.

By the end of this phase you’ll move around the terminal of a Linux server with ease. You’ll know how to:

  • Move through folders, read and edit files, and chain commands together.
  • Tell what users, permissions, processes and services are.
  • Configure programs with environment variables and write small scripts.
  • Log in to a remote server over SSH with your own key.
  • Use Git from the terminal, knowing what happens inside.
  1. The shell: commands and paths
  2. Files and text
  3. Pipes and redirection
  4. Users and permissions
  5. Processes and signals
  6. Services and packages
  7. Environment variables
  8. Shell scripts
  9. SSH
  10. Git internals

Each lesson tells you where its “Try it” happens. There are three places, from smallest to biggest:

Where What for From
Your terminal Moving through folders, working with files, chaining commands, processes, variables and scripts Lesson 1
Your practice server What only a Linux server has: users, services and installing programs. It’s also where SSH takes you Lesson 4
Real servers, on the internet Logging in over SSH to machines that aren’t yours Lesson 9

The practice server is a virtual machine: a computer simulated inside yours, running Ubuntu, the most widely used version of Linux on servers. You’ll create it in lesson 4 with Multipass, a free program from Canonical, the company that makes Ubuntu. Until then you don’t have to install anything.

  • On Windows, follow the course with WSL, as explained in the Phase 0 introduction. WSL is already an Ubuntu, so it will also work as your practice server.
  • If you can’t install anything (on a work computer, for example), WebVM gives you a Linux inside the browser. It’s enough for the first lessons; for the practice server and SSH you’ll have to install something.

First, check which system is underneath your terminal:

1. Which system do you have?

Ventana de terminal
uname

What you will see:

Darwin

uname prints the name of the system. On a Mac you get Darwin, the core of macOS. On Linux and WSL you get Linux. The servers in this phase will say Linux.

The exercises in this phase create, move and delete files. So that they never touch anything of yours, they always happen inside a practice folder.

They won’t ask you for administrator permissions on your computer either: whatever needs them is done on the practice server. The only exception is installing that server, in lesson 4.

Create the folder now. Copy the three lines, paste them into the terminal and press Enter:

2. Your practice folder

Ventana de terminal
mkdir -p ~/backend-course/phase-1
cd ~/backend-course/phase-1
pwd

What you will see:

/Users/ana/backend-course/phase-1
  • mkdir creates a folder (it comes from make directory). With -p it also creates any missing folders along the way, and doesn’t complain if they already exist.
  • cd takes you to that folder.
  • pwd tells you which folder you’re in.

In lesson 1 you’ll see what each part means, including the ~. Your result will be different: we’ve replaced the username with an example one, ana, and on Linux and WSL the path starts with /home instead of /Users.

phase-1 · introduction