A few commands you must know to smoothly handle your Raspberry Pi.
- vidyakamath1004
- Dec 2, 2022
- 2 min read
Updated: Jan 11, 2023
If you want to start making real projects, the Raspberry Pi is one of the simplest devices you can own. Here are a few commands that will help you better explore your Pi.
Need to configure your Pi? Type the following in your terminal
sudo raspi-configTo find the total amount of disk space in the SD card:
df -hTo see the list of processes running:
ls -ATo test the Camera Module:
vcgencmd get_cameraTo get the GPIO pin configuration:
pinoutTo install any package :
sudo apt-get install {package_name}To remove any package:
sudo apt remove {package_name}To update your Raspberry Pi:
sudo apt update To upgrade your Raspberry Pi:
sudo apt upgrade To Create/Open file:
sudo nano {file_name}
Note:
use Ctrl+X -> 'Y' -> 'Enter' to Save and Exit. Disk CleanUp:
sudo apt-get clean
sudo apt-get autoremoveTo Visualize the Available Space:
df -hTo list all the installed packages:
apt list --installed To force SHUTDOWN the Raspberry Pi when its frozen:
Hold alt + prt sc and Press the Keys in the order: 'R' 'E' 'I' 'S' 'U' 'B' to Reboot the Pi. Replace the last key 'B' with 'O' if you want to Shutdown instead of Reboot.
NOTE: Reboot Even If System Utterly Broken
In case you encounter a FORBIDDEN IP error while installing packages or while upgrading your Pi, It is most probable you might be using a wrong mirror to fetch the packages for your Pi. Do the following to set your own mirror :
sudo nano letc/apt/sources.listReplace the line
with the link for the mirror for your country/region from the Raspberry Pi website.
Use Ctrl+X -> 'Y' -> 'Enter' to Save and Exit.
Now you can try upgrading your Pi :
sudo apt upgradeTo list all the details of network connections
sudo ifconfigTo list wireless lan extentions
sudo iwconfigTo check status of different network connections
rkfill list allTo manually set your wlan on Pi
sudo nano /etc/wpa_supplicant/wpa_supplicant.confType the code below:
cntrl_interface=/var/run/wpa_supplicant
update_config=1
country={Your_country_code}
network={
ssid={your_net_name}
psk={your_net_password}
}Use Ctrl+X -> 'Y' -> 'Enter' to Save and Exit.
To disable IVP6 when network issues arises:
sudo dhcpcd -4To scan the wireless lan networks
sudo iwlist wlan0 scanTo View the details of your Raspberry Pi Processor
cat /proc/cpuinfoAdditional ..
HOW TO IDENTIFY YOUR PI?
You only need to check the marking on the RAM chip if your Raspberry Pi is currently in front of you. See the image below (8GB version displayed):




Comments