Terminal in Raspbian

Even though Raspbian features a nice GUI that you can use for many day-to-day tasks, to get a greater control of your Raspberry Pi you will need to use the terminal. The terminal (also known as the shell or command-line interface) is a text-based interface that accepts and interprets your commands. You can use terminal commands in Raspbian to run programs, execute scripts, manipulate files, etc.

The default terminal on the Raspberry Pi devices running Raspbian is called LXTerminal. If you’ve ever worked in the Command prompt in Windows, you will find the interface similar – it is a text-based interface in which you type in commands and get a response. To open LXTerminal from the GUI, click on the third icon on the right of the Menu bar:


The LXTerminal window looks like this:

lxterminal window

Notice the prompt:

pi@new-hostname~ $

The prompt shows your username (pi) and the device hostname (new-hostname). The ~ sign indicates that we are currently located in the home directory of the pi user (/home/pi/ in this case).

To execute a command in the terminal, simply type a command and press Enter. For example, to display the current date and time, enter date and press Enter:

date command

The terminal has accepted our input and displayed the result of the command execution (in this case, the current date is displayed on the screen). We will learn many more useful commands in the following lessons. Note that most of the commands we will go through are included in other Linux distributions, such as Ubuntu or Red Hat.

Geek University 2022