CHAPTER 1 · 2 lessons · 26 exercises

Where you are, and files

Work out where you are right now, and make folders and files with your own hands.

The reason the command line feels frightening is usually that there is nothing on the screen. No icons, no pictures of folders, no back button. Just one short line.

But in fact everything is written right there. The ~ in ~ $ is where you are, and the $ is the signal that says "go ahead, type something". Learn to read those two characters and the screen starts to look different.

There are two things to do in this chapter. Know where you are and move about, and make boxes and files yourself.

The first half is three commands: pwd (where am I?), ls (what is here?) and cd (go there). Only three, but everything you do with files sits on top of them. Nine times out of ten, "file not found" just means the place you thought you were in is not the place you are in.

The second half is mkdir (make a box), touch (make an empty file), cp (duplicate), mv (move or rename) and rm (remove). This is where everything you used to do by dragging and dropping turns into words.

One thing to hold on to. What rm removes does not go to a wastebasket. You cannot undo it. That is why this course has you practise removing things somewhere safe. Get the habit into your fingers here and you will not go pale in front of a real computer.

What you type into is a real Linux running inside your browser. When something goes wrong, the error comes out in plain English. It has not been softened for you, because that is the form you will meet after you graduate. You will pick up how to read it as you go.

Note that this course is still being written, and lessons will keep appearing from the top down.

Lessons in this chapter

Where you are right now

  1. 01Where am I?Walk around and find your files, with just pwd, ls and cd.Go to the exercises

Create, move, remove

  1. 02Make it, move it, remove itHandle files and boxes with your own hands, using mkdir, touch, cp, mv and rm.Go to the exercises

Next up is “Look inside a file”. Check what is in a file without opening it. See just the top and the bottom, count the lines, work out what it really is.