RPi Console Intro

Most used Linux console commands for operating on the Raspperry Pi. This is a list of frequently used console commands while using Raspberry Pi with Raspbian. This document is a combination of knowledge gathered from online materials and experience. Feel free to contribute via GitHub.

If you are searching for more than this, check out the Learning the Shell tutorial by William E. Shotts, Jr.

This is a good introducion to CLI as well: Comand Line 101

The commands

ls

Lists curent directory contents. By issuing this command you can see what files and folders there are in the current directory you are.

ls /home/pi
Desktop  Downloads  ocr_pi.png  openFrameworks  python_games  startup.sh  wayland

pwd

Tells the current directory you are in starting from the root level. For example:

pwd
/home/pi/user

cd

Change directory. This is the main navigation command within the Raspberry Pi terminal environment. cd /home/pi takes you to the home directory. When you execute ls again, you should see an output similar to the following:

cd /home/pi
ls
Desktop  Downloads  ocr_pi.png  openFrameworks  python_games  startup.sh  wayland

mkdir

Create (make) directory. mkdir test creates a directory with the name test.

touch

Creates a blank file. touch test.txt creates a blank .txt file.