A list of useful Raspberry Pi commands. All of these commands can be executed in the Raspberry Pi Shell Terminal or via an SSH connection. Initial Setup I recommend Balena Etcher to burn the Raspbian image and then plug in your monitor to walk through the setup process. If you want to do a headless install and setup of a Raspberry Pi, then PiBakery is helpful. It's available for Windows and Mac. Software Updates Check the Software Version cat \/etc\/os-release Software Updates Updating System Packages sudo apt update then to do a software upgrade of you Raspberry Pi sudo apt full-upgrade then remove any un-needed packages for software that is no longer installed sudo apt autoremove it's a good idea to clean up the repository (this won't look like it does anything, but it does) sudo apt-get clean Exit the Shell exit Housekeeping and Maintenance Restart Raspberry Pi Not typically necessary on Linux based systems, but can be useful after updates. \u00a0sudo reboot Raspberry Pi Config Tool If you need to get into the Pi system configuration tool. You can enable SSH, VNC, rename your Raspberry Pi from here without going into the shell terminal. sudo raspi-config Changing Raspberry Pi Hostname Edit both sudo nano \/etc\/hostname and sudo nano \/etc\/hosts Pi-Hole Commands Install Pi-Hole curl -sSL https:\/\/install.pi-hole.net | bash Change Pi-Hole Password sudo\u00a0pihole\u00a0-a -p Pi-Hole Software Updates This will upgrade the core Pi-Hole software. Assumes you have Pi-Hole installed already, learn more here. pihole -up During an update, the Pi-Hole will refresh the blocklists and Gravity. Pi-Hole Gravity, Blocklists, Whitelists If you need to just do a basic update of the exclusion and inclusion lists and gravity, it's easier to do this from the web interface (Tools - Update Gravity). Pi-Hole Lists and the Gravity database can be exported\/imported from Teleporter (found in Settings - Teleporter). It is possible to use and get good results with the default Pi-Hole lists. If you're after more lists the Firebog.net is commonly recommended. Another good source is Filterlists. Here's what I use. https:\/\/raw.githubusercontent.com\/StevenBlack\/hosts\/master\/hosts https:\/\/mirror1.malwaredomains.com\/files\/justdomains https:\/\/s3.amazonaws.com\/lists.disconnect.me\/simple_tracking.txt https:\/\/s3.amazonaws.com\/lists.disconnect.me\/simple_ad.txt https:\/\/v.firebog.net\/hosts\/AdguardDNS.txt https:\/\/v.firebog.net\/hosts\/Easylist.txt https:\/\/hosts.oisd.nl\/ Note, this last one fully blocks TikTok. https:\/\/raw.githubusercontent.com\/llacb47\/mischosts\/master\/social\/tiktok-block Recommended Allow List URLs www.bit.ly bit.ly ow.ly j.mp goo.gl tinyurl.com t.co wp.me Pi-Hole Debug pihole -d Read through the output to identify any potential bug. You can optionally upload the debug file to the PiHole developers. The output is saved to \/var\/log\/pihole_debug.log and it can be read with Nano. Repair If you need to repair your PiHole installation, use this command pihole -r And select repair. Text Editing with Nano Edit A Text File e.g. hosts, etc. using Nano Text Editor sudo nano Useful Log Files (content viewable\/editable with Nano) sudo nano \/var\/log\/messages sudo nano \/var\/log\/syslog sudo nano \/var\/log\/dmesg Raspberry Pi 4 - Power & Heat Management Eeprom Update (Raspberry Pi 4) This works on the Raspberry Pi 4 and is to update the Eeprom to minimize the overheating risks. Only needed if you have an older version Raspberry Pi 4 as newer models have the updated Eeprom already. The following commands in this order. sudo apt update sudo apt upgrade sudo apt install rpi-eeprom Advanced Raspberry Pi Tips Dynamic DNS If you're looking to setup Dynamic DNS on your Raspberry Pi, you can do it natively on the device using NoIP Dynamic DNS. Instructions for NoIP Dynamic DNS on Pi here. Minecraft Server Want to run your own Minecraft Server? Best suited to a Pi 3 or 4, learn how to setup a Pi Minecraft Server here. You will also need to make sure you open a port on your Firewall, the default port for Minecraft is 25565 If you need to check you have setup your Minecraft server so that it is visible from the outside world, try this Minecraft Server Status Tool. Setup Pi as a Recursive DNS This is more than just Pi-Hole and establishes your Pi as\u00a0the DNS server. So it caches requests locally. This gives you more privacy. The Raspberry PI FAQs detail the recursive DNS process and there's an alternate approach here. Everything Else The Pi My Life Up website is a good resource for Pi How To articles.