I always wanted to sync history of my all shell session.
Let the mac sleep
How to turn off/sleep OS X Mac Screen. It took me a lot of researching on internet to find these shortcut keys.
Sleep immediately (no confirmation): Cmd-Opt-Eject
Put display to sleep: Ctrl-Shift-Eject