Fundamentals of Raspberry Pi 4

Linux commands

# Basics:
sudo shutdown -h now # shutdown system now
poweroff # shutdown
sudo reboot # reboot system
sudo apt-get update # update list of packages without installing anything
sudo apt-get upgrade # upgrade installed packages obtained with ‘apt-get update’
sudo rpi-update # update RPi OS kernel & VideoCore firmware to the latest pre-release versions.
ls -ap # list files (together with hidden)
sudo apt install vim # install Vim text editor
sudo apt autoremove # to remove package
sudo dpkg-reconfigure locales # to set localisation (spacebar to select/deselect)
cp -r /home/DATA/. . # copy from /home/DATA to current folder
du -h # memory occupied by a folder

# Compile
chmod 777 [name] # allow every user to read, write and execute the file [name]
df -h # Memory used
cd ~ # go home directory
pwd # current directory

# Network
ifconfig # get ip address info 
iwlist wlan0 scan | grep SSID # check wifi on wireless network device
scp -P 10709 username@lia_tbl.unist.ac.kr:/home/username/filename.mp4 . #transfer from server to local directory
hostname -I # IP address

# Camera (if connected):
vcgencmd get_camera
# should output
# supported=1 detected=1
raspivid -t 10000 # 10 sec stream, if cam doesn't work try upgrade
raspivid -t 0 # constantly stream video

# SSH from client PC on same network:
ssh pi@<PI-IP-ADDRESS> #(192.168.0.125 pw:raspberry)