Raspberry Pi

10 Useful commands on Raspberry Pi

Raspberry Pi operating system is a distribution of Linux that is Debian-based and designed especially for the Raspberry Pi single-board computers, but it can be installed on other computers as well. The beautiful feature of Debian-based operating systems is that they can be managed by using the command-line interface known as the “Terminal”.

There are different commands which are used in the Raspberry Pi operating system, but in this guide, we will discuss the top ten useful commands of Raspberry Pi that every user of Raspberry Pi OS should know.

1: What are the commands to update and upgrade packages on Raspberry Pi OS

Like other Debian-based distributions, Raspberry Pi comes with different packages which can be installed using the apt package manager, and the developers of these applications release new updates which can be installed using the command:

$ sudo apt update && sudo apt full-upgrade -y

2: What are the commands to make and remove directory on Raspberry Pi OS

In Raspberry Pi, different directories are used to store the files and other important files just like the folders in Windows. We will create a directory with the name of “LinuxHint” using the “mkdir” command:

$ mkdir LinuxHint

3: What is the command to list down contents on Raspberry Pi OS

Now we will use the “ls” command to list down the contents of the directory:

$ ls

It can be seen in the new directory “LinuxHint” that has been created.

4: How to move a directory from one directory to another in Raspberry Pi OS

To move the directory and files from one directory to another we will use the “mv” command, for example, we will mv the directory “LinuxHint” directory from the home directory to Documents directory:

$ mv LinuxHint Documents

5: What is the command to navigate another directory in Raspberry Pi OS

To navigate from one directory to another, we will use the “cd” command, for example, we will navigate to the “Documents” directory by using the command:

$ cd Documents

6: What is the command to remove the directory in Raspberry Pi OS

If you want to remove the directory, then use the “rmdir” command, for example, we will remove the directory of “LinuxHint”:

$ rmdir LinuxHint

7: What is the command to display the date on Raspberry Pi OS

To display the today’s date on the Raspberry Pi, we will use the command:

$ date

8: What is the command to display the hostname on Raspberry Pi OS

Hostname is the name of the computer by which it can recognize in the network by other machines and to display the hostname of Raspberry Pi OS:

$ hostname

9: What is the command to display the IP address on Raspberry Pi

The IP address is the address by which your machine can be recognized in the internet world and the IP address of the machine can be displayed on Raspberry Pi OS:

$ ip addr

10: What is the command to shutdown the Raspberry Pi OS

To shutdown the Raspberry Pi through the terminal, we will use the command:

$ shutdown -h now

Conclusion

There are many commands that are used to manage the Raspberry Pi operating system through the command-line interface. In this guide, we have discussed the top ten commands which are necessary to know for every user of the Raspberry Pi operating system.

About the author

Hammad Zahid

I'm an Engineering graduate and my passion for IT has brought me to Linux. Now here I'm learning and sharing my knowledge with the world.