Here are some useful Terminal commands

Show Hidden Files
Shows hidden files in the Finder
defaults write AppleShowAllFiles YES; killall Finder

Hide Hidden Files
Hides hidden files in the Finder again
defaults write AppleShowAllFiles NO; killall Finder
Flush DNS
Flush the DNS cache on macOS 10.10.4 and up (requires admin password)
sudo killall -HUP mDNSResponder
Quit When Finished Printing
When you print, by default, it leaves an app open on your dock for the printer — running this will make that app quit automatically when it’s finished printing. (requires a reboot)
defaults write "Quit When Finished" -bool YES

Don’t Quit When Finished Printing
Reverse the change. (requires a reboot)
defaults write "Quit When Finished" -bool NO
Refresh Launchpad
Makes your Launchpad look nice and tidy. Apple apps will be in default order on the first page, then all other apps in alphabetical order on the second page.
defaults write ResetLaunchPad -bool true; killall Dock
NOTE: This command no longer works on macOS 10.13 and newer (if you are using the APFS File System)
Reset Dock Icons
Resets the available Dock icons to the factory defaults
defaults delete; killall Dock
I’ve created app versions of the commands using Automator, you can download them here. These apps make running the commands effortless.