Skip to content
Step by Step Internet 🌐 Guides for learning to surf the Net

How to use the command console on Raspberry Pi like an expert? Step by step guide

When they tell you that you must master a command console, they literally tell you to become “Neo” so that see, understand and change the original code of the “Matrix”, in this case your Raspberry.

Even if Raspberry PI OS is based on Linux, a desk is often not required to do the main tasks. For that, there is the terminal where you will write hundreds of lines of code with which you configure and automate tasks.

Check everything you need to know about the terminal of your Raspberry Pi, in any of its versions. We leave you a list of the most common commands that you must memorize to make the best use of your device.

What is the Raspberry Pi command console and what is this tool for?

It is a small application with which you communicate directly with your Raspberry Pi device. It is the safest and fastest way to schedule tasks, make inquiries and connect with the different functions of your project and that are controlled by this mini computer.

We show you some of the advantages of using the terminal of your Raspberry Pi:

  • Direct communication: As we mentioned, with the terminal you make inquiries and receive information related to the device or the tasks that you have been programming. To achieve this communication, there are thousands of commands that this device supports.
  • User control: on a Raspberry device you are a basic user or a super user. There are ways to tell the team that you are one of the two possible figures and with the terminal you can be both, everything will depend on the type of code that is used.
  • Download control: a desktop environment is not required to download files and programs. It is enough to know the exact commands for you to do all kinds of tasks. Therefore, programmers prefer to write lines of code, it is faster and more secure.
  • Feed your ego: Believe it or not, a professional programmer will not use the Raspberry Pi OS desktop to do basic or complex tasks. So it’s not frowned upon for people to notice that you can’t do simple tasks using commands.
  • Ease of reprogramming: It is easier to work from a command terminal than to remove your Raspberry from the project we are doing to place a keyboard and monitor on it. An SSH connection (remote access to a network) is required to have remote control with your device.

Types of command readers in Raspbian What are they all and how are they different?

There are hundreds of ways to establish communication direct with a mini Raspberry computer, but all of them are based on three types of connections.

We will explain each of them:

Shell

Is about any user interface with which you can give commands to an operating system. May exist Graphic shell, more user-friendly, and Shell in which there is only one space to write lines of code.

Terminal

They are also known as output and input devices. In the case of a computer, it can be a monitor and a keyboard, to give a couple of examples. Terminal emulators allow us to have better communication with any computer, even a Raspberry Pi.

CLI

It is a program in charge of interpreting all the instructions that users give it. Are the in charge of getting the instructions to the operating systems. It is the original form of communication, so a Shell in reality is a mediator channel between users and a CLI.

SSH

In reality, is a form of shell that achieves remote communication, even Raspberry Pi computers. It serves for control servers, give instructions and have full access to any function of the equipment and operating systems. It is the preferred way for developers to connect to a Raspberry from another computer.

Console

It is a simple, clean and powerful interface in which users write command lines to achieve literally anything in an operating system. Since Raspberry Pi OS is based on Linux, there are hundreds of free consoles available for a better connection.

Learn step by step how to use the command console of your Raspberry Pi like a guru

The command console in Raspberry Pi OS, formerly known as Raspbian, it’s called bash.

This is a powerful program in which developers write lines of code to control almost everything:

Open console

  • Turn on your device Raspberry Pi.
  • Go to the environment of desk.
  • Look for a black symbol, which simulates command lines.

  • Generally, this symbol is on the top left from the desk.
  • Press that button.

Command console on Raspberry Pi

Run commands

If you can read and write, is all that is required to use a command console that, in reality, it is not as precarious or “basic” as people believe.

There will always be a kind of header with information that is provided to developers:

  • Pi: is the name of the user who is connected.
  • @raspberrypi: is the name of the mini PC.
  • ~: is the name of the path, in this case it is the default path.
  • $: indicates that we can write.
  • #: we can write if a connection has been established as root user.

Command lines on Raspberry Pi

This console has several tricks that you must take into account to be an expert:

  • Enter: you should press it when you are ready to send the command.
  • Tabulation: allows autocomplete some lines of code that are common, they are a kind of shortcuts.
  • Up key: allows access to the command history within the Raspberry Pi default console.
  • Helps: With the “#” character and some textual questions, you can access some help from the OS.

List of the most useful and common commands that you can use on Rasbperry Pi consoles

These are some of the most frequent commands that you need to memorize or have on hand:

  • Sudo: this is how you indicate to Raspberry Pi that the user who writes the commands has super user permission. Example: sudo apt-get update. It is used to update the Raspberry Pi OS repository package list.
  • apt-get upgrade: with this command the updates that have already been downloaded are installed. It is going to be used quite frequently because Raspberry developers make constant changes for security.
  • raspi-config: Open and run the device options menu. There you will be able to know and choose the lines with the available options.
  • cd nombredirectorio: with this command you will be able to access any directory within your Raspberry Pi.
  • cd ..: With this short command you make the console go back to the previous directory. It’s like navigating the file browser interface of Windows or any operating system.
  • ls: shows all files and folders in the location where you are. It is the textual version of seeing the number of files and folders in a location.
  • mkdir nombredirectorio: so you can create a new directory in the location where you are. You are going to use this command very frequently.
  • nano /ruta/nombrearchivo: in this way you will be able to create and edit any file within the directory where you are.