I use iTerm and a lot of terminal tabs. Terminal history is something which is important to me, it lets me backtrack my steps. Just add the following code in your
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