{"id":60143,"date":"2022-03-11T09:30:00","date_gmt":"2022-03-11T14:30:00","guid":{"rendered":"https:\/\/jumpcloud.com\/?p=60143"},"modified":"2024-01-29T11:51:12","modified_gmt":"2024-01-29T16:51:12","slug":"how-to-logoff-restart-shutdown-macos","status":"publish","type":"post","link":"https:\/\/jumpcloud.com\/blog\/how-to-logoff-restart-shutdown-macos","title":{"rendered":"How to Logoff, Restart, or Shutdown macOS Systems"},"content":{"rendered":"\n
This article continues our series on the common commands every Mac admin should know. Check out the previous articles in this series to learn how to:<\/em><\/p>\n\n\n\n Jump to Tutorial<\/a><\/p>\n\n\n\n The major responsibilities of Mac sysadmins include managing, troubleshooting, maintaining, and updating macOS. Sometimes, the GUI becomes unresponsive. In these cases, it is critical for IT admins to understand how to logoff, restart, and shutdown the systems remotely, via the terminal. This tutorial presents the commands that can be executed in the command line to logoff, restart, or shutdown macOS systems.<\/p>\n\n\n\n Before we dive into executing these commands via the terminal, it\u2019s important to get acquainted with the difference between the actions. <\/p>\n\n\n\n Logging off simply means you log out of the user profile; the Mac will show the login screen where the user will need to log in before they can use the system again. <\/p>\n\n\n\n Restarting means to reboot the device so that it starts afresh. If you restart a device, it will close all the active applications on the device and go through the startup process automatically. You can also you the command line to check the last reboot<\/a> of a device.<\/p>\n\n\n\n Putting 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 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\n Here, we will use the We added If you want to schedule the device to shut down at a specific time, you can define that with the command below. The “hh” in For 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 Alternatively, 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 To restart your macOS system via the terminal app, we will also leverage the The Note that the 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 You 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 Run the following command to logoff of your MacBook (Figure 8):<\/p>\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\n In 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\n
Difference Between Logoff, Restart, and Shutdown on macOS<\/h2>\n\n\n\n
Logging Off, Restarting, or Shutting Down macOS Systems via the Terminal App<\/h2>\n\n\n\n
1. Shutting Down a macOS System<\/h3>\n\n\n\n
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\n
sudo shutdown -h now<\/code><\/p>\n\n\n\n
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\n
hhmm<\/code> represents hours (in 24-hour time) while “mm” represents minutes of the time.<\/p>\n\n\n\n
sudo shutdown -h hhmm<\/code><\/p>\n\n\n\n
sudo shutdown -h 2219<\/code><\/p>\n\n\n\n
sudo shutdown -h +30<\/code><\/p>\n\n\n\n
2. Restarting a macOS System<\/h3>\n\n\n\n
shutdown<\/code> command. Run the following command (refer to Figure 4):<\/p>\n\n\n\n
sudo shutdown -r now<\/code><\/p>\n\n\n\n
-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\n
sudo shutdown -r +60<\/code><\/p>\n\n\n\n
+60<\/code> represents 60 minutes (one hour) from the present time.<\/p>\n\n\n\n
3. Putting a macOS in Sleep Mode<\/h3>\n\n\n\n
sudo shutdown -s now<\/code><\/p>\n\n\n\n
sudo shutdown -s +10<\/code><\/p>\n\n\n\n
4. Logging Off a macOS System<\/h3>\n\n\n\n
sudo pkill loginwindow<\/code><\/p>\n\n\n\n
Wrap Up<\/h2>\n\n\n\n