Eject a stuck CD
Sometimes you'll put a CD, DVD, or blu-ray in your Mac's SuperDrive, but MacOS won't see it. If it can't see the disc, it won't let you Eject it! Try this command to force eject the drive tray.
drutil tray eject
Clear a bunch of notifications
If you got a whole pileup of notifications in Notifications Center that would take forever to dismiss by hand, this should make them all go away. (You won't be able to get them back!)
killall NotificationCenter
Schedule a command to run later
Use the sleep command followed by semicolon to put a timer on your command. Sleep takes times in seconds: sleep 60
is one minute, sleep 3600
is one hour.
The semicolon between commands means the second command will wait until the first command is finished. The third command will wait for the second command to finish, and so on.
sleep 3600; cp -nvR ~/source /Volumes/destination; echo "done!"
Clear DNS Cache
If you've recently made a DNS change to a domain name and MacOS / Safari is still stuck on the old DNS info, try this.
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
Restart the Finder
Even Finder gets confused sometimes. -HUP is the polite way to tell it to restart.
killall -HUP Finder