Using the Terminal in Raspbian with LXTerminal
Learn what the Raspbian terminal is, how to open LXTerminal, read the shell prompt, and run the date command on a Raspberry Pi.
The terminal is a text-based interface for communicating with the operating system. Instead of selecting buttons and menus, you type commands and read the results printed by the system.
On a Raspberry Pi desktop, the graphical terminal application is called LXTerminal. It provides a window in which a shell runs. The shell reads your commands and starts the requested programs.
Terminal, terminal emulator, shell, and CLI
These terms are closely related, but they are not always technically interchangeable:
- Terminal: a text-oriented interface used to enter commands and view their output.
- Terminal emulator: a graphical application that provides a terminal window. LXTerminal is a terminal emulator.
- Shell: the command interpreter running inside the terminal window. It reads typed commands and starts programs.
- Command-line interface (CLI): a user interface based on typed commands rather than graphical controls.
- Prompt: text displayed by the shell to show that it is ready for a command.
A useful comparison for Windows users is Command Prompt: type a command, submit it, and read the response. The exact commands and behavior differ between operating systems, but the interaction style is similar.
Why use the command line?
A graphical desktop is convenient for common tasks. You can open a file manager, select a folder, and click buttons to copy or rename files. At the command line, you describe the action by typing a command. This can provide more direct and precise control over the Raspberry Pi, especially when a graphical option is unavailable or when you need to repeat an operation.
From the command line, you can:
- Run installed programs and command-line utilities.
- Execute scripts.
- Inspect files and directories.
- Create, move, rename, and otherwise manage files and directories.
Later lessons can build this into a larger command vocabulary, including directory management, file management, and running programs.
Open LXTerminal from the Raspbian desktop
- Look at the desktop panel or menu bar.
- Find and select the launcher for LXTerminal, usually represented by a terminal icon.
- If the icon is not visible, open the desktop application menu and search for a terminal application.
The exact icon position can differ between Raspbian desktop versions and customized layouts. After you select the launcher, a new terminal window should open. It normally displays a prompt, with a cursor waiting for your command.
Read the shell prompt
A newly opened terminal might show a prompt like this:
pi@new-hostname:~ $
The prompt contains information about the current session. In this example:
The username and hostname are specific to the device. For example, another user might see:
alex@raspberrypi:~ $
This has the same structure: alex is the username, raspberrypi is the hostname, ~ identifies the user's home directory, and $ identifies a regular-user prompt. A shell theme or custom prompt can change the appearance, so focus on the roles of the parts rather than expecting identical text.
Enter and run a command
The basic command-line cycle is:
- Wait for the prompt to show that the shell is ready.
- Type a command after the prompt.
- Press Enter to submit it.
- Read the command's output in the same terminal window.
- Wait for a new prompt, which generally appears when the command has finished.
For example, when the prompt is shown, the command-entry area is after the dollar sign:
pi@new-hostname:~ $ date
You type date and press Enter. You do not type the sample prompt.
Your first command: date
date is a standard command that displays the Raspberry Pi's current system date and time.
pi@new-hostname:~ $ date
Mon Aug 17 12:34:56 UTC 2026
pi@new-hostname:~ $
The first line contains the prompt and the command you entered. The next line is command output: text printed by the program. The final line is a new prompt, showing that the shell is ready for another command. The exact date, time, format, and timezone depend on the device's settings and locale.
If the displayed date or time is unexpected, the Raspberry Pi's system clock, timezone, or network time synchronization may not be configured correctly. The date command reports the current setting; correcting it is a separate clock and time-configuration task.
Terminal vocabulary
Command portability
Many basic commands used on Raspbian are standard Linux or Unix tools. You will often find the same commands on Ubuntu and Red Hat family systems. This makes basic command-line knowledge useful across several Linux distributions.
However, portability is not absolute. Package-management commands, desktop launchers, installed software, configuration tools, and the exact format of output can differ between distributions and releases. Check the instructions for the operating system you are using before applying a command from another system.
Troubleshooting
LXTerminal is not visible on the panel
The desktop layout may differ from the illustrated Raspbian version, or the launcher position may have been customized. Look for a terminal icon, or use the desktop application menu to search for a terminal application. Do not rely on a fixed icon number or panel position.
The prompt does not match the example
The username may be different, the hostname may have been changed, or the shell prompt may be customized. Identify each part by its role: account name, machine name, current-directory indicator, and final prompt character.
The date or time is incorrect
The Raspberry Pi clock, timezone, or network time synchronization may need attention. Treat date as a display command and use a separate lesson on clock, timezone, and time synchronization for correction steps.
The dollar sign or full sample prompt was typed
Only enter the command text after the prompt. For this example, remove the prompt text and type:
date
Nothing appears to happen
Enter may not have been pressed, the command may still be running, or the terminal window may not have keyboard focus. Click inside the terminal, confirm that the cursor is at a prompt, type the command, and press Enter.
Next steps
Once you can open LXTerminal, identify the prompt, and run date, you are ready to learn more commands. Continue with Useful Terminal Commands, or explore remote access to Raspbian when you want to use a terminal from another computer.