Difficulty: beginner
Estimated Time: 10-15 minutes

Don't panic!

Don't worry about running any commands in this environment - you can't break anything here!

Commands can be transcribed from the left to the terminal on the right or clicked.

If clicked, the command will be run in the terminal on the right and you will see the results straight away.

The command line is case sensitive, so always type commands exactly as given. For more complex commands spaces are important as well.

Always try to type these commands yourself as this will make it easier to get the hang of it!

Things we will be covering:

  • How to run commands in a terminal window
  • What a working directory is
  • Find out where you are in the filesystem (pwd)
  • How to list the contents of a directory (ls)
  • How to make a directory (mkdir)
  • How to move into a new directory (cd)
  • Briefly touch upon absolute and relative paths
Command Description
pwd Print your working directory
ls List the contents of a particular path
cd Move to a particular path (or change directory)
mkdir Make a directory at a particular path

Amber Wright

Things we have covered:

  • Commands are written on a command prompt
  • Directory is another word for folder
  • Not to be afraid of the command line!
  • Find out where you are in the filesystem (your working directory) (pwd)
  • That a working/current directory is where you are in the filesystem
  • How to list the contents of a directory (ls)
  • How to make a directory (mkdir)
  • How to move into a new directory (cd)
  • That .. means directory above or parent directory
  • Briefly touched upon absolute and relative paths
Command Description
pwd Print your working directory
ls List the contents of a particular path
cd Move to a particular path (or change directory)
mkdir Make a directory at a particular path

Now you're ready to try Tutorial 2 where we will be covering how to open and read files on the command line.

Don’t stop now! The next scenario will only take about 10 minutes to complete.

Tutorial 1: Introduction to Command-line

Step 1 of 6

Run your first command!

A prompt will be displayed in the terminal window on the right. A prompt is a set of characters printed on the screen that show you where you will be writing your commands. It also tells you that the command line is ready to process your instructions.

Prompts will look slightly different on different systems but for this tutorial they will be:

> or $

To instruct your terminal to do something, you need to enter specific commands and press enter.

Don't panic!

Don't worry about running any commands in this environment - you can't break anything here!

Let's try running a command that doesn't exist:

hello

You should get the following message telling you what you already know:

bash: hello: command not found

This error message is telling you what is complaining and why. Error messages happen all the time and are not necessarily a bad thing. Some are helpful and descriptive and can tell you what you need to do instead.

The error message is telling you that bash (the command line interpreter - the software that executes your commands) has an issue with the command hello and that issue is that the command hello doesn't exist.

That's all pretty sensible and boring!

Tasks

1) Try running some silly made-up commands

Here are some ideas!

  • hello world
  • qwerty
  • 123