3. Using the Terminal
important
This page is primarily for users who started with Sphero's preconfigured SD card image, as described in the Quick Start Instructions. If you are already familiar with using the terminal on your Pi, you can skip to SSH setup.
Open the terminal
You'll be using the terminal on your Pi to enter commands. From the desktop, click the icon shown in the toolbar at the top of your screen to open the terminal:
Run a command
Let's check our Python version. In your terminal, type the following and then press enter:
python3 --version
There, you just ran your first command in the terminal! It should have printed the Python version to the terminal as shown below:
important
Notice that the command was python3
, not python
. Without the 3 you'll run Python 2.x.x, which is incompatible with the RVR+/RVR SDK. If you didn't start with the Sphero preconfigured SD card image, you might see a different version here. That's okay as long as it's 3.5.3 or higher.
Some Common Bash Terminal Commands
When you use the terminal, you are interacting with a program called a shell. The default shell in Raspberry Pi OS is bash. The following commands are all bash commands, but many are common to other shells, such as zsh.
Command | Syntax | Description |
---|---|---|
cd | cd <newPath | cd stands for Change Directory. Used for navigating to a different directory specified in <newPath> . |
mkdir | mkdir <newDir> | Make Directory. Creates a new directory named <newDir> within the current working directory. |
ls | ls <dir> | List contents of the current working directory (with no arguments). List contents of directory <dir> if specified. <dir> may be a relative or absolute path. |
sudo | sudo <command> | Superuser Do. Some commands require elevated security permissions to run. For those, use sudo in front of the command. |
nano | nano <file> | Opens the nano text editor, which allows you to edit files inside the terminal. If <file> is specified, nano will open it for editing. |
tip
The more you use bash, the more comfortable and efficient you will become. One helpful feature is bash autocompletion. Press the Tab key to auto complete partially-typed command sequences.
Learning More
If you're new to using Bash, the Raspberry Pi Foundation has a fun Pac-Man treasure hunt on the terminal tutorial that will help you get comfortable hacking in the terminal.
Next!
Proceed to the next section to set up SSH on your Pi to be able to access your Pi's terminal from another device.