top of page

Raspberry Pi Commands
-------------------------------------------
sudo apt-get update-sync packages 
sudo apt-get upgrade-upgrades packages 
sudo clear-clears screen 
sudo date-prints date 
sudo find / -name example.txt-searches for the file 
sudo nano example.txt-opens text editor nano 
sudo raspi-config-configuration settings menu 
sudo poweroff-shutdown immediately 
sudo reboot-reboot immediately 
sudo shutdown -h now-shutdown immediately 
sudo shutdown -h 01:22-shutdown at 1:22 AM 
sudo startx-opens the gui 
sudo cat example.txt-displays example.txt 
sudo cd /abc/xyz-changes the current dir to the /abc/xyz 
sudo cd ~-change to your home dir 
sudo cp XXX-copies the file or dir XXX pastes it to a specified location 
sudo chmod [who][+,-,=][permissions] [name]Change the permissions for a file 
sudo chmod 777 [name]-Allow all users to read, write and execute the file 
sudo chmod u+x [name]-Allow the user to execute [name] 
sudo ls -l-lists files 
sudo mkdir example_directory-creates a new directory 
sudo mv XXX-moves the file or dir XXX 
sudo rm example.txt-delete file 
sudo rmdir example_directory-deletes dir 
sudo scp user@10.0.0.32:/some/path/file.txt-copies a file over ssh 
sudo touch example.txt-creates a new empty file 
sudo ifconfig-check status of wireless connection 
sudo iwconfig-check network the adapter is using 
sudo iwlist wlan0 scan-prints a list available wireless networks 
sudo iwlist wlan0 scan | grep ESSID-list the ESSID 
sudo ping-tests connectivity between two devices 
sudo wget http://www.website.com/example.txt-downloads file example.txt from the web 
sudo cat /proc/meminfo-shows details about your memory 
sudo cat /proc/partitions-shows size/number of partitions 
sudo cat /proc/version-shows ver rasp pi 
sudo df -h-info about the disk space 
sudo df /-free disk space is available 
sudo dpkg - -get-selections | grep XXX-shows all of the installed packages 
sudo dpkg - -get-selections-shows all installed packages 
sudo free-free memory available 
sudo hostname -I-ip address rasp pi 
sudo lsusb-usb connected to rasp pi 
sudo UP key-print the last command 
sudo vcgencmd measure_temp-temperature of cpu 
sudo vcgencmd get_mem arm && vcgencmd get_mem gpu-shows the memory split between the cpu & gpu 
sudo grep-Search inside one or more files 
sudo head-Return all occurrences 
sudo ls-List the contents of the current dir 
sudo ls -a-List all files 
sudo ls -l-List the contents of the current dir 
sudo man-Open the manual/help page 
sudo mkdir-Create a directory 
sudo mv -r-Move all files and dir 
sudo pwd-Show the name of the current dir 
sudo python/python3 -version-Shows ver of Python 
sudo-Superuser do 
sudo apt-get install-Install a package 
sudo sudo apt-get update-Update the list of packages 
sudo apt-get upgrade-Upgrade the installed packages 
sudo chown pi:root-Change the owner of the file 
sudo raspi-config-config menu 
sudo reboot-restart your Pi 
sudo shutdown -h now-shutdown immediately 
sudo su-root dir with root user access 
sudo tail-Show the end of file 
sudo tar -cvzf-Create compressed file 
sudo tar -xvzf-Extract contents of compressed file 
sudo wget [uri]-Download the file found at [uri] from internet 
sudo raspistill-take a still image 
sudo raspivid-take a video 

-------------------------------------------
Raspberry Pi New Install

sudo apt-get update-sync packages
sudo apt-get upgrade-upgrades packages
sudo clear-clears screen
sudo apt install rpi-imager-installs rpi imager
curl -sSL https://git.io/JfAPE | bash-install Pi Kiss
wget -qO- https://raw.githubusercontent.com/Botspot/pi-apps/master/install | bash-install pi apps

-------------------------------------------
Raspberry Pi General Commands

sudo apt-get update-sync packages
sudo apt-get upgrade-upgrades packages
sudo clear-clears screen
sudo date-prints date
sudo find / -name example.txt-searches for the file
sudo nano example.txt-opens text editor nano
sudo raspi-config-configuration settings menu
sudo poweroff-shutdown immediately
sudo reboot-reboot immediately
sudo shutdown -h now-shutdown immediately
sudo shutdown -h 01:22-shutdown at 1:22 AM
sudo startx-opens the gui

-------------------------------------------
Raspberry Pi File Directory Commands

sudo cat example.txt-displays example.txt
sudo cd /abc/xyz-changes the current dir to the /abc/xyz
sudo cp XXX-copies the file or dir XXX pastes it to a specified location
sudo ls -l-lists files
sudo mkdir example_directory-creates a new directory
sudo mv XXX-moves the file or dir XXX
sudo rm example.txt-delete file
sudo rmdir example_directory-deletes dir
sudo scp user@10.0.0.32:/some/path/file.txt-copies a file over ssh
sudo touch example.txt-creates a new empty file

-------------------------------------------
Raspberry Pi Network Commands

sudo ifconfig-check status of wireless connection
sudo iwconfig-check network the adapter is using
sudo iwlist wlan0 scan-prints a list available wireless networks
sudo iwlist wlan0 scan | grep ESSID-list the ESSID
sudo ping-tests connectivity between two devices
sudo wget http://www.website.com/example.txt-downloads file example.txt from the web

-------------------------------------------
Raspberry Pi System Commands

sudo cat /proc/meminfo-shows details about your memory
sudo cat /proc/partitions-shows size/number of partitions
sudo cat /proc/version-shows ver rasp pi
sudo df -h-info about the disk space
sudo df /-free disk space is available
sudo dpkg - -get-selections | grep XXX-shows all of the installed packages
sudo dpkg - -get-selections-shows all installed packages
sudo free-free memory available
sudo hostname -I-ip address rasp pi
sudo lsusb-usb connected to rasp pi
sudo UP key-print the last command
sudo vcgencmd measure_temp-temperature of cpu
sudo vcgencmd get_mem arm && vcgencmd get_mem gpu-shows the memory split between the cpu & gpu

-------------------------------------------
Reset Password

Power down and pull the SD card out from your Pi and put it into your computer. 
Open the file 'cmdline.txt' and add 'init=/bin/sh' to the end. This will cause the machine to boot to single user mode. 
Put the SD card back in the Pi and boot. 
When the prompt comes up, type 'su' to log in as root (no password needed). 
Type "passwd pi" and then follow the prompts to enter a new password. 
Shut the machine down, then pull the card again and put the cmdline.txt file back the way it was by removing the 'init=/bin/sh' bit.

-------------------------------------------

©2023 by ArferNower. Created with Wix.com

bottom of page