last reboot<\/a> of a device.<\/p>\n\n\n\nPutting the device in sleep mode will initiate a screensaver to conserve energy. Wiggling the mouse or tapping the space bar will wake it up again. Depending on the settings, it may or may not require the user to enter their password upon waking. The device is immediately ready for the user to work on all the apps and programs that were running before putting it in sleep mode.<\/p>\n\n\n\n
Finally, just as the name implies, shutting down a MacBook means that you shut down the entire macOS system. All active applications will close once the device turns off. If the user hasn\u2019t quit each app before shutting down the device, the apps will reopen automatically, allowing the user to get back to work more quickly. <\/p>\n\n\n\n
Logging Off, Restarting, or Shutting Down macOS Systems via the Terminal App<\/h2>\n\n\n\n In this section, we will go through how you can execute a command in the terminal app to restart, shutdown, logoff, or put your device in sleep mode. To get started, you need to launch the terminal app. Simply search \u201cterminal\u201d using the Spotlight search option on your device or navigate through Applications > Utilities > Terminal<\/strong>.<\/p>\n\n\n\n1. Shutting Down a macOS System<\/h3>\n\n\n\n Here, we will use the shutdown<\/code> command. All you need to do to shutdown your device with immediate effect is to run the following command (Figure 1):<\/p>\n\n\n\nsudo shutdown -h now<\/code><\/p>\n\n\n\nFigure 1<\/figcaption><\/figure>\n\n\n\nWe added sudo<\/code> to the command to gain admin-level privileges. When you run the command, you will have to provide your admin password. The -h<\/code> argument will halt all processes immediately. Executing the command with no arguments will shut down your macOS after a minute. Either way, using the terminal to shut down the device will make it inaccessible. <\/p>\n\n\n\nIf you want to schedule the device to shut down at a specific time, you can define that with the command below. The “hh” in hhmm<\/code> represents hours (in 24-hour time) while “mm” represents minutes of the time.<\/p>\n\n\n\nsudo shutdown -h hhmm<\/code><\/p>\n\n\n\nFor instance, if you want to shutdown the device at 10:19 p.m., you should run the following command (Figure 2):<\/p>\n\n\n\n
sudo shutdown -h 2219<\/code><\/p>\n\n\n\nFigure 2<\/figcaption><\/figure>\n\n\n\nAlternatively, you can schedule your device to shutdown at a particular time by defining minutes alone. For example, if you want your macOS to shut down exactly 30 minutes from now, simply run the following command (Figure 3):<\/p>\n\n\n\n
sudo shutdown -h +30<\/code><\/p>\n\n\n\nFigure 3<\/figcaption><\/figure>\n\n\n\n2. Restarting a macOS System<\/h3>\n\n\n\n To restart your macOS system via the terminal app, we will also leverage the shutdown<\/code> command. Run the following command (refer to Figure 4):<\/p>\n\n\n\nsudo shutdown -r now<\/code><\/p>\n\n\n\nFigure 4<\/figcaption><\/figure>\n\n\n\nThe -r<\/code> argument tells the system to restart. Executing the now<\/code> argument will restart your macOS immediately. However, you can schedule your device to restart after a specific period of time. For example, if you want your device to restart in one hour, you should run the following command (Figure 5):<\/p>\n\n\n\nsudo shutdown -r +60<\/code><\/p>\n\n\n\nNote that the +60<\/code> represents 60 minutes (one hour) from the present time.<\/p>\n\n\n\nFigure 5<\/figcaption><\/figure>\n\n\n\n3. Putting a macOS in Sleep Mode<\/h3>\n\n\n\n You can also use the shutdown command to put your macOS in sleep mode. All that is required is to run the following command (Figure 6):<\/p>\n\n\n\n
sudo shutdown -s now<\/code><\/p>\n\n\n\nFigure 6<\/figcaption><\/figure>\n\n\n\nYou can schedule the device to sleep at a specific period. For instance, if you want your device to go to sleep mode 10 minutes from now, you should run the following (Figure 7):<\/p>\n\n\n\n
sudo shutdown -s +10<\/code><\/p>\n\n\n\nFigure 7<\/figcaption><\/figure>\n\n\n\n4. Logging Off a macOS System<\/h3>\n\n\n\n Run the following command to logoff of your MacBook (Figure 8):<\/p>\n\n\n\n
sudo pkill loginwindow<\/code><\/p>\n\n\n\nFigure 8<\/figcaption><\/figure>\n\n\n\nWrap Up<\/h2>\n\n\n\n In this article, we discussed important commands you should understand as you continue to manage macOS systems within your fleet. You are now acquainted with how to logoff, restart, shutdown, or put a macOS device into sleep mode via the terminal app. <\/p>\n\n\n\n
Note that you can also leverage the JumpCloud Directory Platform to manage your entire Mac fleet. The streamlined MDM tool<\/a> enables IT admins to lock, restart, shut down, or even erase any of the remote or on-prem Mac systems in their fleet with the click of a button. <\/p>\n\n\n\nIn addition to managing macOS devices, IT admins can also manage Windows and Linux devices as well as identities, access, and other IT resources from one central location in the cloud. Try JumpCloud today by signing up for a trial<\/a>. <\/p>\n","protected":false},"excerpt":{"rendered":"Learn how to use the command line to logoff, restart, or shutdown macOS systems in part 4 of our tutorial series for Mac admins <\/p>\n","protected":false},"author":131,"featured_media":60145,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_oasis_is_in_workflow":0,"_oasis_original":0,"_oasis_task_priority":"","inline_featured_image":false,"footnotes":""},"categories":[23],"tags":[],"collection":[2778],"platform":[],"funnel_stage":[3017],"coauthors":[2568],"acf":[],"yoast_head":"\n
How to Logoff, Restart, or Shutdown macOS Remotely- JumpCloud<\/title>\n \n \n \n \n \n \n \n \n \n \n \n \n\t \n\t \n\t \n \n \n \n\t \n\t \n\t \n