Skip to main content

How to do Basic Commands in Terminal

Raspberry Pi Terminal Command Cheat Sheet

CommandDescription
lsList all files and directories in the current folder
cd foldernameChange to a specific directory
cd ..Go up one directory
mkdir myfolderCreate a new directory called myfolder
rm myfile.txtDelete a file called myfile.txt
rm -r myfolderDelete a folder and its contents
cp file1.txt file2.txtCopy file1.txt to file2.txt
mv file.txt folder/Move file.txt into the folder
nano script.pyEdit a Python script using the built-in text editor
python3 script.pyRun a Python 3 script
chmod +x script.shMake a shell script executable
./script.shRun an executable shell script
sudo shutdown nowShutdown the Raspberry Pi immediately
sudo rebootReboot the Raspberry Pi
clearClear the terminal screen