top of page

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-config
  • To find the total amount of disk space in the SD card:

df -h
  • To see the list of processes running:

 ls -A
  • To test the Camera Module:

vcgencmd get_camera
  • To get the GPIO pin configuration:

pinout
  • To 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 autoremove
  • To Visualize the Available Space:

df -h
  • To 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.list

Replace 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 upgrade
  • To list all the details of network connections

sudo ifconfig
  • To list wireless lan extentions

sudo iwconfig
  • To check status of different network connections

rkfill list all
  • To manually set your wlan on Pi

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

Type 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 -4
  • To scan the wireless lan networks

sudo iwlist wlan0 scan
  • To View the details of your Raspberry Pi Processor

cat /proc/cpuinfo

Additional ..

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):
ree

The marking code at the time of writing is as follows:
1GB - 4HBMGCJ
2GB - D9WHZ
4GB - D9WHV
8GB - D9ZCL

The Raspberry Pi 4 Model B is shown here. If your Pi is a Pi3 or lesser model, the RAM chip will be visible on the underside. Hope that was helpful.




Recent Posts

See All

Comments


Follow

  • Facebook
  • Twitter
  • LinkedIn

©2022 by Freedom Explorer. Proudly created with Wix.com

bottom of page