Specifications
42
Learn how to access hardware-level controls like restarting,
shutting down, powering up, and selecting boot options
from the command line.
This chapter introduces commands for shutting down or restarting a local or remote
computer. Computers need to be shut down or restarted, whether locally or remotely,
when installing tools or making computer repairs.
Restarting a Computer
To restart a computer at a specic time, use the reboot or shutdown -r command.
For more information, see their man pages.
To restart the local computer:
$ shutdown -r now
To restart a remote computer immediately:
$ ssh -l root computer shutdown -r now
To restart a remote computer at a specic time
$ ssh -l root computer shutdown -r hhmm
Parameter Description
computer The IP address or DNS name of the computer
hhmm The hour and minute when the computer restarts
Automatic Restart
You can also use the systemsetup tool to set the computer to start up after a power
failure or system freeze, by specifying a number of seconds:
systemsetup -setwaitforstartupafterpowerfailure seconds
6
Accessing Apple Hardware from
the Command Line