sudo apt update
sudo apt upgrade
sudo apt install <package_name>
sudo apt remove <package_name>
sudo apt autoremove
apt search <keywords>
dpkg -l
sudo shutdown now
sudo reboot
uname -a
df -h
free -h
Change directory:
cd <directory_path>
List files and folders in the current directory:
ls
Display detailed information (including permissions, owner, size, etc.):
ls -l
Create a new folder:
mkdir <directory_name>
Create a new file:
touch <file_name>
Copy files or folders:
cp <source> <destination>
Move files or folders:
mv <source> <destination>
Delete files:
rm <file_name>
Delete folders and their contents:
rm -r <directory_name>
View file contents:
cat <file_name>
Edit files:
nano <file_name>
Compress files or folders:
tar -czvf <archive_name.tar.gz> <folder_or_file_to_compress>
Decompress files:
tar -xzvf <archive_name.tar.gz>
Update the package list:
sudo apt update
Upgrade installed packages:
sudo apt upgrade
Search for available packages:
apt search <keywords>
Install packages:
sudo apt install <package_name>
Uninstall packages:
sudo apt remove <package_name>
Clean up unnecessary packages and cache:
sudo apt autoremove
Display installed package information:
dpkg -l
List detailed information of a specific package:
apt show <package_name>
Find the file path of a package:
dpkg -L <package_name>
Lock/unlock package versions:
sudo apt-mark hold <package_name>sudo apt-mark unhold <package_name>
Check package dependencies:
apt depends <package_name>
View system load and uptime:
uptime
View current memory usage:
free -h
View current CPU usage:
top
View overall CPU usage:
mpstat
View disk space usage:
df -h
Monitor network traffic:
iftop
Monitor real-time process status:
htop
View temperature sensor data (requires Raspberry Pi to have this feature):
vcgencmd measure_temp
cat /proc/cpuinfo
sudo lsb_release -a
Open the terminal window, you can connect via VNC or open directly on Raspberry Pi.
Edit the /etc/apt/sources.list file, you can open it with any text editor, for example, using the nano editor:
sudo nano /etc/apt/sources.list
In the opened file, find and comment out the original source for backup. The way to comment is to add a hash (#) at the beginning of the source line, for example:
# deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi
Add a new system source. You can choose a suitable mirror source and add it to the end of the file. Here is an example:
deb http://mirrors.aliyun.com/raspbian/raspbian/ buster main non-free contrib
Press Ctrl + X, then enter Y to save changes, and finally press Enter to confirm saving.
Update the package list:
sudo apt update
After completing the update, you can use the new system source to install, update, and upgrade packages.
mkdir -p ~/.pip touch ~/.pip/pip.conf
nano ~/.pip/pip.conf
[global] index-url = https://pypi.tuna.tsinghua.edu.cn/simple

Want to know more
Quickly scan the code to follow