Category Archives: Raspberry Pi

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 with Linux LESSON 8: Sending Linux Command Output to a File

This lesson shows that we can redirect the output of our Linux commands to a file instead of the terminal window.

If we have a command like:

$ ls

The output is the list of files and folders in the current directory. If we instead want to send the output to a file we could use the followingg:

$ ls >out_file.txt

The list of files and folders is directed to a new file called out_file.txt.  Note that all the same rules for paths still applies.

If we issued the command again, the old contents of the file would be overwritten. If we wanted to append the results to the end of the file instead of overwriting, we could do the following:

$ ls>>out_file.txt

When we use >> instead of >, the results will be appended to the end of the file.

Raspberry Pi with Linux LESSON 7: Using the Wildcard

In this lesson we learn how to use the Linux wildcard. The wildcard allows you to automate what would otherwise be tedious tasks. The wildcard is the * character. For example,  a command with *.txt would affect all files ending in .txt. Similarly, *.* would affect all files. You could also imagine dog*.txt would affect all files that start with “dog” and end with .txt. The video gives many examples of using the wildcard to simplify things.

Raspberry Pi Linux LESSON 6: Move, Copy, and Delete Files and Folders

In this tutorial we learn how to move, copy and delete files and folders in the Linux terminal window on the Raspberry Pi. These will allow you to start working with files and folders like a pro. Please watch the video above and follow along on your Raspberry Pi. It is really important that you become proficient at navigating the files from the terminal window and command line, and you know how to move, copy and delete files.