How to Restart & Shutdown your Mac using Terminal

terminal in mac

Shutting down your MacBook using terminal gives you more options and versatility than shutting down through the Apple power button. In this guide, we will show you how you can restart and shut down your MacBook by giving a command in Terminal.

Shutting Down your Mac via Terminal using “Sudo” Command

Here’s how you can do it:

  1. Open “Terminal” manually or use Spotlight Search, press Command + Space to open Spotlight Search, type “Terminal” and open it from the search results.terminal
  2. You will have to use the “sudo” command or else Terminal will give you an error message.not super user error
  3. The “Sudo” command gives you superuser security privileges. Give the following command:

sudo shutdown -h <time>sudo command and password

Instead of <time> type the time when you want to shut down your Mac. If you want to do so at the very moment, type now. If you want to do it an hour later, type +60. Press Enter key and type your MacBook’s password.

Your MacBook will shut down at the specified time.

Restarting your Mac via Terminal

Here’s how you can restart your MacBook via Terminal:

  1. Open “Terminal” manually or use Spotlight Search, press Command + Space to open Spotlight Search, type “Terminal” and open it from the search results.terminal
  2. When terminal launch, type the following command:

sudo shutdown -r <time>restarting macbook using sudo command

Type the specific time when you want your MacBook to restart again instead of the <time> in the command. If you want your MacBook to start immediately type “now”, otherwise type “+60” if you want it to restart an hour later. At the end type your MacBook’s password and your device will restart at the specified time.

You may also like to check out How to Take Screenshots on MacBook

Leave a Reply

Your email address will not be published. Required fields are marked *