Difficulty: beginner
Estimated Time: 10-15 minutes

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.

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

Things we will be covering:

  • Overview of how most commands on command line are structured
  • What a man page is
  • How to find the man page for a given piece of software (man)
  • How to read what you need from a man page
  • Learning some new ways of running ls using man page info
Command Description
man Find and open the man page for a command
ls List the contents of a particular path

Amber Wright

Things we have covered:

  • Overview of how most commands on command line are structured
  • What a man page is
  • How to find the man page for a given piece of software (man)
  • Man page conventions e.g. What brackets and ellisis mean
  • How to read what you need from a man page
  • Learning some new ways of running ls using man page info
  • Some command options start with - some with --
  • If you can't find help in the manual - try running the command with --help!
Command Description
man Find and open the man page for a command
ls List the contents of a particular path

Now you're ready for tutorial 4!

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

Tutorial 3: Familiarising yourself with the unfamiliar

Step 1 of 6

Step 1 - Review - structure of commands

In the previous tutorial we covered how to open a file in less along with how to move through the file and search for particular words. We were able to find out how to use less by using the help that was packaged with the software.

Help is packaged up with almost all commands - you just need to find out where and how to read it. This is what this tutorial will be covering.

This tutorial will be covering what to do when you're faced with unfamiliar commands. First though, let's review what we've learned from the commands we've already tried.

Note:

Anywhere I write something in angle brackets (< >) e.g. <something> is a placeholder for something the user would add themselves e.g. if you were telling you how to run mkdir you might write:

mkdir <path>

to indicate that you need to add a filepath after the mkdir command.
What you put instead of the angle brackets depends on what you want to achieve e.g. what you want to name your directory (mkdir) or which directory you wish to move to with cd.

Command What it does
pwd prints working directory
ls lists what is saved in your working directory (files and directories)
ls <path> lists what is saved in "path" (files and directories)
ls -l <path> lists (in detail) what is saved in "path" (files and directories)
ls -l -h <path> lists (in detail) what is saved in "path" (files and directories) with human-readable units
mkdir <path> makes a directory at "path"
cd <path> changes your working directory to "path"
less <path> opens the file "path" for reading

What you might have noticed is that these follow a similar structure:

<command>

or

<command> <arguments / options>

Some commands have arguments and some don't. Arguments and options can be anything you can type - numbers, letters, paths etc and customise the command you are running. There are multiple ways of specifying arguments and some need to be entered with a specific structure but how do you work out what options are available for what program? How do you know what types of argument are allowed? What defaults does the software use?

Read the manual A.K.A the man page!