0% found this document useful (0 votes)
130 views2 pages

Terminal Commands - Quick Cheat-Sheet

This document provides a cheat sheet of common terminal commands for navigating directories, manipulating files, installing and updating software, installing Python modules, and other useful commands for working with a Raspberry Pi. It includes commands for listing directory contents, changing directories, editing and moving files, installing and removing packages, installing Python modules, shutting down or rebooting the RPi, checking the IP address, and more. Additional notes provide tips for using auto-complete, command history, file extensions, and stopping running commands.

Uploaded by

agriafun
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
130 views2 pages

Terminal Commands - Quick Cheat-Sheet

This document provides a cheat sheet of common terminal commands for navigating directories, manipulating files, installing and updating software, installing Python modules, and other useful commands for working with a Raspberry Pi. It includes commands for listing directory contents, changing directories, editing and moving files, installing and removing packages, installing Python modules, shutting down or rebooting the RPi, checking the IP address, and more. Additional notes provide tips for using auto-complete, command history, file extensions, and stopping running commands.

Uploaded by

agriafun
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Terminal Commands - Quick cheat-sheet

Here is a list of commands to keep on the side when you work on this Raspberry Pi course.

Navigation
ls Print the content of a directory

ls -a Same as ls, but also shows hidden files

pwd Print the directory where you are now

cd <dir_name> Navigate to directory

Manipulate files
nano <file_name> Open the file in nano editor, also creates the file if
doesn’t exist

touch <file_name> Create a new file

mkdir <dir_name> Create a new directory

mv <file_path> <new_file_path> Move a file and/or rename it

cp <file_path> <new_file_path> Copy a file to a new file

rm <file_name> Remove a file

rm -rf <dir_name> Remove a directory and everything inside, recursively

cat <file_name> Print the content of a file


Install software
sudo apt update Update sources to latest

sudo apt install <package_name> Install a package

sudo apt remove <package_name> Remove a package

sudo apt upgrade Upgrade already installed packages to latest version

Install Python modules


pip3 install <module_name> Install a Python module

pip3 uninstall <module_name> Uninstall/remove a Python module

pip3 list Print all installed Python modules

Other commands
sudo shutdown now Shutdown the Raspberry Pi

sudo reboot Reboot the Raspberry Pi

hostname -I Print IP address of the RPi

df -h Print currently used and available space on SD card

python3 <file_name.py> Execute a Python3 script in the terminal

man <command_name> Manual for a given command

A few additional notes


- Use auto completion as much as you can (press TAB), this will save you a lot of time.
- To go back to previously executed commands, use the up arrow key on your keyboard.
- No need to add a .txt extension to create a text file, you can use whatever extension you
want, or not use any.
- Some commands are very quick to execute and return directly (ex: “pwd”). Other
commands can take some time (ex: “sudo apt upgrade” or running a Python script).
Press CTRL+C to stop a running command.

You might also like