Skip to content

Beginner guide ​

In ten minutes you read the prompt, move between folders, create a file, edit it, open a second tab and learn where the help is. No Linux experience is needed.

What you need ​

  • Ubuntu Terminal installed or the portable file. See Install.
  • A keyboard. Everything here is typed.

Read the prompt ​

Open Ubuntu Terminal. After a welcome line you see the prompt:

text
you@pc-name:~$
PartMeaning
youYour Windows user name
pc-nameThe name of your PC
~The folder you are in. ~ is short for your user folder, such as C:\Users\you
$The terminal is ready for a command

You type a command after the $ and press Enter. The terminal prints the result and shows a new prompt.

Look around ​

  1. Type pwd and press Enter. It prints the folder you are in.

  2. Type ls. It lists the files and folders there, in colour.

  3. Type ll. It lists the same things with details: size, date, and hidden files whose names start with a dot.

  4. Type cd Documents to go into your Documents folder. The prompt changes to ~/Documents.

  5. Type cd .. to go back up one level. Typing cd on its own always returns to your user folder.

TIP

Press Tab to complete a file or folder name after typing its first letters. Press the up arrow to bring back the previous command.

Make a folder and a file ​

  1. Create a practice folder and go into it:

    bash
    mkdir practice
    cd practice
  2. Create a file with one line of text. The > sends the output of echo into a file:

    bash
    echo "hello from the terminal" > notes.txt
  3. Show the file's contents:

    bash
    cat notes.txt
  4. Copy it, then rename the copy:

    bash
    cp notes.txt backup.txt
    mv backup.txt old-notes.txt
    ls

    ls now shows notes.txt and old-notes.txt.

These are ordinary files in C:\Users\you\practice. You can see them in File Explorer too.

Edit the file ​

The editor is vi. It has two modes: one for commands and one for typing. That surprises everyone the first time, so follow these keys exactly.

  1. Open the file:

    bash
    vi notes.txt
  2. Press i to start typing. Type some text.

  3. Press Esc to stop typing.

  4. Type :wq and press Enter to save and leave.

To leave without saving, press Esc, then type :q! and press Enter. More in Edit files with vi.

Open a second tab ​

  1. Press Ctrl + Shift + T, or select the + button at the top right. A new tab opens in your user folder.

  2. Click a tab to switch to it. Each tab is a separate terminal.

  3. Press Ctrl + Shift + W, or select the × on a tab, to close it.

Copy and paste ​

In a terminal, Ctrl + C stops the running command. So copying uses a different shortcut:

  • Select text with the mouse, then press Ctrl + Shift + C to copy.
  • Press Ctrl + Shift + V to paste.

Clean up ​

Remove the practice folder and everything in it:

bash
cd ~
rm -rf practice

DANGER

rm deletes at once. Files do not go to the Recycle Bin and cannot be restored. rm -rf deletes a folder with everything inside it without asking. Check the name, and the folder you are in, before you press Enter.

Get help ​

Type helpme for a short list of the commands that work. Most commands also explain themselves when you add --help, for example cp --help.

What you learned ​

  • The prompt shows who and where you are.
  • ls, cd, mkdir, cp, mv, cat and rm cover most file work.
  • vi edits files: i to type, Esc, then :wq to save and leave.
  • Tabs give you several terminals in one window.

Next steps ​