Tag Archives: Tutorial

Raspberry Pi Linux LESSON 10: Properly and Safely Shutting Down the Raspberry Pi

It is very easy to corrupt the SD card and your operating system on your Raspberry Pi. It is important to always properly shut down the raspberry pi. Never just remove power, always shutdown first. Never remove the SD card while the pi is booted or while it is powered. To remove the SD card, first shutdown the pi, then take the power off, then remove the card. Similarly, never plug the card in while the pi is powered.

The simplest way to shutdown the pi is with the command:

$ sudo halt

Instead, if you want to shutdown and then reboot, you can use:

$ sudo reboot

These two commands will take care of things most of the time. If for some reason sudo halt does not work, you can try the following:

$ sudo shutdown -h now

That will pretty much always work.

Raspberry Pi Linux LESSON 5: File Naming Convention for Files and Folders

Windows is pretty forgiving in how you name your files and folders. In Linux, you must remember that things are case sensitive, and you want to avoid using spaces in your file names and folder names. Also remember, that in linux folders are also called directories. This video shows three suitable naming conventions in Linux that allow the files names to be both descriptive and readable.

Raspberry Pi Linux LESSON 4: Creating and Editing Text Files Using Nano Command

As we learn more about the Raspberry Pi, we will get to the point that we will need to write programs. We have learned how to write python programs in our earlier tutorial series on the Arduino. Good news is that we can apply what we learned there to the Raspberry Pi. But, we will first have to learn how to create and edit text files. The text editor we will use on the Raspberry Pi is called “nano”. We will learn how to use nano by creating and editing simple text files. Also in this lesson we learn how to make new directories in Linux using the mkdir command. We also learn that we can view a file without opening it by using the “cat” command.

Watch the video above for all this information. These concepts are best taught and learned by watching and doing. So, watch the video and do the commands along with me. You will be an expert in no time!

Raspberry Pi Linux Lesson 3: Navigating the Folders and Files in Linux

The first thing we need to learn with Linux is how to navigate the file/folder structure in Linux. In windows we do this by just clicking on pictures of folders and files. The file structure in Linux operates the same way. We have a top level folder we call the root folder, and then we have folders and files inside of folders, and then those folders can have more folders and files. It is a tree type structure that you are already familiar with. What is different is we navigate through the files in Linux from the command lines, and not by clicking on pictures of windows and folders. Once you master the command line, you will prefer that to the clicking on pictures method of Windows.

In this lesson we will learn how to navigate through the files. In Linux, you first give the “waht”, that is what you want to do, or the command you want to do, and then you give the “where”, that is, where in the file structure you want to execute the command.

The first command we can learn is pwd. By typing pwd in the command line it will show you what folder you are presently in. That is useful as you are learning to navigate as it will always show you where you are.

The next command is ls. ls simply lists the files and folders in the present folder.

The final command covered in the video lesson above is cd, which stands for change directory.

After the command, you give the “where”, which is the path to where you want to do the command.

The method of navigating and understanding the file structure is easier to communicate by showing you, so please watch the video above. If you follow the video, you should clearly understand how the path methodology works in linux.