rpi terminal cheat sheet codes

fukurou

the supreme coder
ADMIN
Navigation
**********
pwd # active directory
cd // # starter dir (/home/user)
cd / # root dir (/)
cd path # go to path dir
cd .. # go one dir back
ls # list items in the dir
ls -a # show dirs, files and hidden files

edit files
**********
# extensions are omittable
nano file3.txt # create||edit a file.
cat file2.txt # read file contents

CRUD
****
touch abc # create file
rm abd # remove file
mkdir new_folder # create a folder
rm -rf new_folder/ # del dir and contents
mv file_path new_file_path # Move a file & or rename it
cp file test # copy file

misc
****
clear # clear the screen
sudo shutdown now # now or minutes amount
sudo reboot # Reboot the Raspberry Pi
hostname -I # get IP address of the RPi
df -h # get SD card free space
python3 file_name.py # run file
ctrl + c->exit() # exit shell
man command_name # Manual for a given command

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
sudo apt autoremove # remove unneeded packages


Install Python modules
**********************
pip3 install module_name
pip3 uninstall module_name
pip3 list # Print all installed Python modules
pip3 list | grep GPIO # module search

notes
*****
1 you can use ~ instead of /home/user
2 tab key auto complete path while typing
3 To go back to previously executed commands,
use the up arrow key on your keyboard.
 
Last edited:
Top