When working at your Mac, there may be times when you would like to simply shut off the monitor without interrupting your work. For example, if you are downloading files or in the middle of processing a large amount of data that will take hours to complete, or if you are simply playing music and do not want to view anything on your display, then you might like to blank out the display.
OS X supports putting a display to sleep after a period of inactivity, which you can set in the Energy Saver system preferences; however, in addition it supports several options for immediately putting your display to sleep:
Open the Terminal and run the following command:
Press the following keys on your keyboard, depending on whether or not your Mac has an eject key or a power button:
Note that for third-party keyboards, you might need to find the key mapped to the “Eject” function, and press that. This may require you hold the Fn key. You will also have to hold the Fn key if your Mac’s F-keys are set to be standard function keys instead of Apple’s special features. This setting is available in the Keyboard system preferences.
Click the “Hot Corners…” button in the Desktop & Screen Saver system preferences, and then choose “Put Display to Sleep” as the function for a specified hot corner. Then move your mouse to this corner and the display will sleep.
With these options, you can quickly put your Mac’s display to sleep while keeping the computer active in the background. Keep in mind that if you have the system set to require a password upon waking from sleep or screen saver deactivation (set in the General section of the Security & Privacy system preferences), then you will need to authenticate when waking your display back up. Otherwise, upon pressing a keyboard or mouse button you will be right back at your desktop.