An oldie but goodie, pressing Alt-F4 brings up a Windows shut-down menu, with the shut-down option already selected by default. (You can click the pull-down menu for other options, like Switch. The shutdown command will, as expected, shut down your Mac when used in Terminal. But there are some important options that you will also want to use to make this shutdown timer meet your needs. $ sudo shutdown -s +30. Shutdown the machine in 60 minutes: $ sudo shutdown -h +60. Cancel any of the above: $ sudo killall shutdown “Do all men kill the things they do not love?” The Merchant of Venice. Related macOS commands: kill - Stop a process from running. Login - log into the computer. Osascript - shutdown/restart via AppleScript. Using the arp command allows you to display and modify the Address Resolution Protocol (ARP) cache. An ARP cache is a simple mapping of IP addresses to MAC addresses. Each time a computer’s TCP/IP stack uses ARP to determine the Media Access Control (MAC) address for an IP address, it records the mapping in the ARP cache so that future ARP lookups go faster.
-->Enables you to shut down or restart local or remote computers, one at a time.
Syntax
Parameters
Parameter | Description |
---|---|
/i | Displays the Remote Shutdown box. The /i option must be the first parameter following the command. If /i is specified, all other options are ignored. |
/l | Logs off the current user immediately, with no time-out period. You cannot use /l with /m or /t. |
/s | Shuts down the computer. |
/r | Restarts the computer after shutdown. |
/a | Aborts a system shutdown. Effective only during the time-out period. To use /a, you must also use the /m option. |
/p | Turns off the local computer only (not a remote computer)—with no time-out period or warning. You can use /p only with /d or /f. If your computer doesn't support power-off functionality, it will shut down when you use /p, but the power to the computer will remain on. |
/h | Puts the local computer into hibernation, if hibernation is enabled. You can use /h only with /f. |
/e | Enables you to document the reason for the unexpected shutdown on the target computer. |
/f | Forces running applications to close without warning users. Caution: Using the /f option might result in loss of unsaved data. |
/m <computername> | Specifies the target computer. Can't be used with the /l option. |
/t <n> | Sets the time-out period or delay to n seconds before a restart or shutdown. This causes a warning to display on the local console. You can specify 0-600 seconds. If you don't use /t, the time-out period is 30 seconds, by default. |
/d [p | u:]<XX>:<YY> | Lists the reason for the system restart or shutdown. The supported parameter values are:
|
/c <comment> | Enables you to comment in detail about the reason for the shutdown. You must first provide a reason by using the /d option and you must enclose your comments in quotation marks. You can use a maximum of 511 characters. |
/? | Displays help at the command prompt, including a list of the major and minor reasons that are defined on your local computer. |
Remarks
- Users must be assigned the Shut down the system user right to shut down a local or remotely administered computer that is using the shutdown command.
- Users must be members of the Administrators group to annotate an unexpected shutdown of a local or remotely administered computer. If the target computer is joined to a domain, members of the Domain Admins group might be able to perform this procedure. For more information, see:
- If you want to shut down more than one computer at a time, you can call shutdown for each computer by using a script, or you can use shutdown/i to display the Remote Shutdown box.
- If you specify major and minor reason codes, you must first define these reason codes on each computer where you plan to use the reasons. If the reason codes aren't defined on the target computer, Shutdown Event Tracker can't log the correct reason text.
- Remember to indicate that a shutdown is planned by using the p parameter. Not using the p parameter, indicates that the shutdown was unplanned.
- Using the p parameter, along the reason code for an unplanned shutdown, causes the shutdown to fail.
- Not using the p parameter, and only providing the reason code for an planned shutdown, also causes the shutdown to fail Apache for mac os.
Examples
Restart Mac From Terminal
To force apps to close and to restart the local computer after a one-minute delay, with the reason Application: Maintenance (Planned) and the comment 'Reconfiguring myapp.exe', type:
To restart the remote computer myremoteserver with the same parameters as the previous example, type: