So you have a Raspberry Pi and you are ready to jump into learning Linux, Python, about GPIO pins, connecting to the IoT, etc. Start by learning a few Linux commands.
I assume you have Raspbian installed and are connected to the Internet. Make sure you are connected to the Internet by browsing to a website. If that worked you should start a terminal session by clicking the icon similar to the one shown below.
Your terminal window (also called console) should appear. It’s a simple screen with the command line at the top. My command line has pi@MainPi:~ $ because I am logged in as the user named “pi” and I’ve named this Raspberry Pi “MainPi”.
Now issue the command sudo apt-get update which may take several minutes to complete. You will be presented with a screen similar to the screenshot below. See the details about this command below the screenshot. Notice the process checks a variety of repositories for updates.
The command sudo (pronounced as “sue do” by some and “sue doe” by others) is a way for you to be given special privileges so that you can execute a command as if you were the root user which is like the system administrator. The command apt-get starts the Advanced Packaging Tool and is used to update, upgrade, install and remove software on your Raspberry Pi.
Now type sudo apt-get upgrade to upgrade versions of the software you have. The difference between update and upgrade is best described by an example. If you had a package (program) named printit 1.1 then update would apply fixes to version 1.1 even if version 1.2 existed. If version 1.2 existed then upgrade would install version 1.2. Since I upgraded a few days ago the output for my upgrade is small.
Now type sudo apt-get dist-upgrade just to be complete. There is a difference between upgrade and dist-upgrade but I don’t understand it. The output is very similar to that of upgrade.
To review our work just type history to see all you have typed at the command line. Here is a partial screenshot from history on my Raspberry Pi where I have typed 300+ commands.
To page through the output from history you apply a “pipe more” to it like so history | more. The output starts at the first command and shows one page at a time. By hitting the spacebar a few times I moved to command 185. The | more can be added to the end of any command if it produces output to the screen.
This is enough to get started. Try the man command out because it yields a useful, concise collection of Linux information at your fingertips. Try the command man history to see a detailed explanation of history or man man to get information on the man command itself.