Command line interface

The Raspberry Pi OS, Raspbian, uses CLI as its primary user interface (which is common for Linux-based operating systems). You can use a secure shell connection to access the command line.

Basic commands

Double-tapping the Tab ↹ key autocompletes the command or its argument. This is known as "tab completion".

Show the contents of the current directory:

ls

Change current (working) directory:

cd catkin_ws/src/clever/clever/launch

Go one directory level up:

cd ..

Print path to the current directory:

pwd

Print contents of the file.py file:

cat file.py

Run file.py as a Python script:

python file.py

Reboot Raspberry Pi:

sudo reboot

You can terminate currently running (foreground) program by pressing Ctrl+C.

Read more about the Linux command line in the Raspberry Pi documentation: https://www.raspberrypi.org/documentation/linux/usage/commands.md.

Editing files

You can use nano to edit files on the Raspberry Pi. It is one of the more user-friendly console-based text editor.

  1. Use the following command to edit or create a file:

    nano path/to/file
    

    For example:

    nano ~/catkin_ws/src/clever/clever/launch/clever.launch
    

    Editing files in nano

  2. Edit the file.
  3. Press Ctrl+X, Y, Enter to save your file and exit.
  4. Restart the clever package if you've changed .launch files:

    sudo systemctl restart clever
    

You may also use other editors like vim if you prefer.

results matching ""

    No results matching ""