OS X: Put the Mac to sleep using the terminal
If your Mac can't go to sleep on OS X, you can force it through the terminal. We'll show you how it's done.
Put the Mac to sleep from the terminal
The following procedure is useful not only if the Mac refuses, but also if you are accessing the Mac remotely. First open the terminal.
- The "pmset sleepnow" command puts the Mac directly into sleep mode. To do this, the logged in user must have administrator rights.
- If this is not the case, the following, somewhat longer command will help you further: osascript -e 'tell application "System Events" to sleep'
- If you have established an SSH connection to your Mac, you need the following command, which you must add your personal data: ssh osascript -e 'tell application "Finder" to sleep'
In the next practical tip, we will show you how to display hidden files and folders under Mac OS X.