Restart Mac From Command Line

By  on  

Restarting and shutting down a computer remotely is a frequent task for remote system administrators. As someone that writes many shell scripts, I also find myself automating system restarts. Let's look at a few ways to restart Mac systems from command line!

Restart a Local Mac

To restart a local Mac system from command line, you can execute:

sudo shutdown -r now

Restart a Remote Mac

To restart a remote Mac system, you can execute:

ssh -l {AdminSystemAddress}
sudo shutdown -r now

Restart at a Specific Time

You can specify a restart at a specific time:

# Format:  sudo shutdown -r hhmm
# Restart at 11:30pm local time
sudo shutdown -r 2330

System restarts are good after massive updates or just for clearing out system resources. These command line examples should help restart a Mac locally or remotely.

Recent Features

Incredible Demos

  • By
    Making the Firefox Logo from HTML

    When each new t-shirt means staving off laundry for yet another day, swag quickly becomes the most coveted perk at any tech company. Mozilla WebDev had pretty much everything going for it: brilliant people, interesting problems, awesome office. Everything except a t-shirt. That had to change. The basic...

  • By
    CSS Fixed Position Background Image

    Backgrounds have become an integral part of creating a web 2.0-esque website since gradients have become all the rage. If you think gradient backgrounds are too cliche, maybe a fixed position background would work for you? It does provide a neat inherent effect by...

Discussion

    Wrap your code in <pre class="{language}"></pre> tags, link to a GitHub gist, JSFiddle fiddle, or CodePen pen to embed!