Here are some useful Terminal commands

Show Hidden Files
Shows hidden files in the Finder
defaults write com.apple.finder AppleShowAllFiles YES; killall Finder

Hide Hidden Files
Hides hidden files in the Finder again
defaults write com.apple.finder AppleShowAllFiles NO; killall Finder
 
Flush DNS
Flush the DNS cache on OS X 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 com.apple.print.PrintingPrefs "Quit When Finished" -bool YES

Don’t Quit When Finished Printing
Reverse the change. (requires a reboot)
defaults write com.apple.print.PrintingPrefs "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 com.apple.dock ResetLaunchPad -bool true; killall Dock
 
HINT: Download the app version below and add it to your Login Items, then your Launchpad icons will always be in alphabetical order
 
Reset Dock Icons
Resets the available Dock icons to the factory defaults
defaults delete com.apple.dock; killall Dock
 
I’ve created little app versions of the commands using Automator, you can download them here. The beauty of these apps is they will open and close the Terminal, and run the command, just by double-clicking them. As an added bonus they will NOT close other Terminal windows if there is something running there.