Raspberry_Pi_Education_Manual

Notes:

Lesson 6.1: Commands are just programs

When you type into the terminal you are running programs. Most of the commands listed here run programs that give you the ability to command the system to do something. When you add programs to your Raspberry Pi, you will be able to run more commands. If you enter a command and it doesn’t work, it may well mean that the program isn’t installed yet. For instance, if you try to create a new text file called “My Linux Commands” using the Nano text editor, you would type:

sudo nano "My Linux Commands"

But it might be that, instead of opening the new text file, your system returns the error message:

bash: nano: command not found

This just means that you have not installed Nano yet. However, most of the commands described on this page are the kind of “housekeeping” commands that come as default, so you shouldn’t have this problem. Each program has an original author who is acknowledged at the bottom of the main page.

Don’t worry too much about the actual commands used there – I will explain everything as we go along.

The Bash shell

To use the CLI, you need to know commands. The default command set is contained in the “ shell ” you are using. There are lots of shells out there, but the one on this Raspberry Pi is called “ Bash ”. Bash is the default command line shell on most versions of Linux, as well as Mac OS, so it’s well worth learning. This chapter covers many of the most common and useful commands. If you can’t find the command you need, try looking online. There are lots of good guides on the internet for using the Linux command line. If you know the command you want to use, but don’t know exactly how to use it – for instance, you don’t know exactly the right “ syntax ” – you can use the “ man ” (manual) command in Linux. At the command line you could type:

Tip...

The “syntax” of a command means the way it should be written to make it work. That means the order of the words, as well as any important punctuation that is also necessary.

$ man

man Displays information about the target, sourced from online reference manuals.

The Linux Command Line

153

Made with FlippingBook flipbook maker