When you first start up your Raspberry Pi you will see a lot of text scrolling across your screen. Don’t worry, that’s normal. Once it has finished booting up you will find yourself at the login prompt with a blinking cursor staring at you. Enter in your username and password and you will end up with something like this:

System Commands
One of the first system commands we need to know about is the
pi@raspberrypi:~ $ sudo <COMMAND>
To update our system we will use the apt-get command. The first thing we need to do when updating our system is to get the currently available packages and versions. After we have the update list we can upgrade our packages to the latest versions. We can run these two commands one after the other but running:
pi@raspberrypi:~ $ sudo apt-get update && sudo apt-get upgrade
The && in between the two commands tells Raspian to run the first command and wait for it to finish then run the second command.
The apt-get command is also how we install new software on our system.
pi@raspberrypi:~ $ sudo apt-get install <APPLICATION PACKAGE>
Later if you decide you no longer want or need that package you can remove it from the system by changing install to remove.
pi@raspberrypi:~ $ sudo apt-get remove <APPLICATION PACKAGE>
Depending on the application this will sometimes leave files on your system, like configuration files, etc. If you want to remove the application complete you will need to run the purge command after removing the application.
pi@raspberrypi:~ $ sudo apt-get purge <APPLICATION PACKAGE>
To reboot the system run:
pi@raspberrypi:~ $ sudo reboot
and to shutdown completely:
pi@raspberrypi:~ $ sudo poweroff
Exploring the Linux Filesystem
The start with we need to know where we currently are in the file system which we can find out by using the print working directory command pwd.
pi@raspberrypi:~ $ pwd
/home/pi
To get a listing of the files we use the ls command. For a basic listing of files in the current directory we can just use:
pi@raspberrypi:~ $ ls
There are a few useful options available with the ls command, like -a, -l, and -R. The -a will list all files include any hidden files in the directory. The -l expands the listing to include additional information about the file like the size, date, and permissions. The -R is an option to list any sub-directories in that directory. It stands for recursive. You can use one or more of these together as well.
pi@raspberrypi:~ $ ls -al
From here we can do a couple of things, either create a file or make a new directory.
To make a directory we will use the mkdir command.
pi@raspberrypi:~ $ mkdir my_directory
pi@raspberrypi:~ $ ls
my_directory
pi@raspberrypi:~ $
Note: you may have other files and directories when you do the ls, so you may see more than just “my_directory”.
To move into our new directory we will use the change directory or cd command
pi@raspberrypi:~ $ cd my_directory
pi@raspberrypi:~/my_directory $ ls
pi@raspberrypi:~/my_directory $
To create a new file we can use a command called touch. Later we can add to the file or edit it. But for now, let’s just create an empty file.
pi@raspberrypi:~/my_directory $ touch my_file.txt
Now if we run the ls command we will find we have a file in the directory now.
pi@raspberrypi:~/my_directory $ ls
my_file.txt
Copy and Move files
Two more commands you will find useful are the copy and move commands. To copy a file we will use the cp command and move a file we use the mv command. The mv command is used to rename a file as well, it moves a file from one name to another name. They both work in a similar way.
cp <FROM FILE> <TO FILE>
mv <FROM FILE> <TO FILE>
Let’s try some examples:
pi@raspberrypi:~/my_directory $ cp my_file.txt new_file.txt
pi@raspberrypi:~/my_directory $ ls
my_directory my_file.txt new_file.txt
pi@raspberrypi:~/my_directory $ mv my_file.txt old_file.txt
my_directory new_file.txt old_file.txt
To see what’s in our files we can run a command called cat. The command has several uses, one of the main uses is to view the contents of a file.
pi@raspberrypi:~/my_directory $ cat new_file.txt
pi@raspberrypi:~/my_directory $
Since our files are empty right now cat will not print anything to your screen. Let’s use the echo command to put some text in the file so we can print it out. The echo command just repeats back to you what you tell it, just like an echo.
echo "Hello World" > new_file.txt
The > after the echo command tells the system to send the output of the command to the file, overwriting the current contents of the file. Since our file is empty this is fine. If you have a file that already has something in it you can use >> to append the output to the file instead of overwriting it. Let’s see what’s in our file and then add more text to it.
pi@raspberrypi:~/my_directory $ cat new_file.txt
Hello World
pi@raspberrypi:~/my_directory $ echo "Goodbye" >> new_file.txt
pi@raspberrypi:~/my_directory $ cat new_file.txt
Hello World
Goodbye
Make sure you use >> when you echo Goodbye to the file or you will end up with just Goodbye in the file. Go ahead and try it:
pi@raspberrypi:~/my_directory $ echo "Goodbye" > new_file.txt
pi@raspberrypi:~/my_directory $ cat new_file.txt
Goodbye
While the echo and cat commands are very useful they aren’t very good for editing files. Luckily there are a couple of editors that come with our system, they are vi and nano. They both allow you to edit files, nano is similar to notepad and is easier for beginners to use. Vi is the original editor for Linux systems and uses keyboard commands. It can be very powerful but is more difficult for beginners to pick up.
Nano
pi@raspberrypi:~/my_directory $ nano new_file.txt

VI
pi@raspberrypi:~/my_directory $ vi new_file.txt

Other useful commands
There are some other commands that will be helpful.
Man pages (manuals)
All these

Raspberry Config
To update your Raspberry PI configuration you will need to use raspi-config. Here you can expand your filesystem, change passwords, set your boot options, and a whole lot more.
pi@raspberrypi:~ $ sudo raspi-config
