Command Line for Mac Timed Shutdown, restart, and sleep
For some reason (programmers know it), they need to connect to the company's computer during off-duty hours to do something. Therefore, the company rarely shuts down its computers. However, after a computer is shut down for several days, the computer will become very stuck. So the first thing to go to the company every morning is to restart the computer. Manual restart is too bad for programmers. So I thought of using the command line to shut down and restart at a specific time.
The command is very simple:
Shutdown:
Sudo shutdown-h yymmddhhmm
Restart:
Sudo shutdown-r yymmddhhmm
Sleep:
Sudo shutdown-s yymmddhhmm
Yymmddhhmm refers to a specific time.
For example, if I want to restart my computer at today (January 1, March 4, 2015), the command should be:
Sudo shutdown-r 1503042230
Enter the password of your computer and press Enter.