Linux Crash Course

The command line, package management and Git: the basics you need for computational practicals.

This is a reference, not a lecture. Use it at a terminal: scroll through it, search it and copy from it. Work through it before a practical, not during one.

Start here

Kickoff slides A short tour of all four parts, in about fifteen minutes
Part 1 — The command line Terminal, paths, commands, pipes, wildcards
Part 2 — Installing and managing tools pixi, and the conda/mamba world you will meet anyway
Part 3 — Git and GitHub Keeping your work, and getting it back
Part 4 — Files you will meet Markdown, JSON, tables, and why text files misbehave

The slides are an overview, not the material itself. If you want to see the whole structure first, click through them before you read Part 1.

NoteYou do not need to finish everything first

You need Part 1 before your first practical. If you can open a terminal, say where you are in the file system, read a command with its parameters, and send the output of one command into another, you know enough to start.

The other parts become important when you need them: Part 2 when you install your own tools, Part 3 when you have work that you want to keep, and Part 4 when a file causes errors.

Who this is for

It is for anyone who will do computational work and has not used a command line before. It assumes no prior experience: not with Linux, not with a terminal, and not with programming.

It does not belong to one course. Several modules link to it, so the examples use ordinary files and folders, not data from one subject. You will work with the real data in your practical. This material is about the tools that you will use for it.

Why a terminal at all

This is a fair question. Here are three reasons, before you spend an evening on this material.

  • Many tools exist only there. Most scientific software has no graphical interface. This is not a mistake: another program can run a command-line program a thousand times, but it cannot run a program that needs a person to click.
  • It is a record. You can copy a command that you typed into the methods section of a report, run it again next year, and someone else can check it. You cannot do this with a series of clicks.
  • It works the same for many files. The command that processes one file can process four hundred files, with the same amount of typing.

The disadvantage is that a terminal does not show you what it can do. A graphical program shows its functions; a terminal shows a blinking cursor and waits. This material teaches you what to type.

How to use it

Type the commands. Do not copy and paste them, at least not at the start. Typing teaches you more than it seems to. The errors that you make while typing now are the errors you would otherwise make later, under time pressure. Now they cost you nothing.

Every command on these pages runs automatically each time this site is built, in an empty directory, on Linux. If an example is on a page, it ran without an error. It may still behave differently on your computer, because versions and default settings differ. But it contains no typo.