Terminal 101: Properly Shutting Down Your Mac

7

Comments

+ Add a Comment
avatar

yojo056

Cory, I'd just like to say that your Terminal 101 articles are one of the main reasons I visit maclife.com. Keep up the good work at making us even more nerdy.

avatar

mprusse

What's the command to log off all users before shutdown as mentioned in the opening paragraph? Thanks.

avatar

corybohon

When you have users logged into the system and initiate any of the shutdown commands, you'll get a message printed to the screen.

avatar

henrydevon

I'm not clear of advantages via terminal. Thx

avatar

corybohon

The Terminal is really for power users, allowing them to do things without messing around with the UI. Simply type the command, and you're done.

The second important advantage of using the Terminal to complete commands is that if you use SSH to connect to a Mac remotely, you can easily issue commands to the remote Mac. Using the tips above, you can shutdown, reboot, or sleep the Mac remotely just by typing in a command. (By remote, I mean, you could do this with a machine around the world). That's the true power of the Terminal.

avatar

DavidABQ

Hi,
Great article, I look forward to future Terminal 101 articles.
I have a question relating to this article:
For the Timed Shutdown examples, is there a way to stop the delayed shutdown process once the command has been issued (in case the need to reboot resolved itself before the actual command has done it job)?
Thanks, David

avatar

corybohon

You can cancel a shutdown by issuing a pkill (process kill) or a killall command on the shutdown command. So, to cancel a shutdown, simply enter one of the following commands into a Terminal window: 

pkill shutdown 
sudo killall shutdown 

Using the second (killall) command, you'll be prompted to enter your password. You'll get an error message that "No matching processes were found" if the shutdown command is no longer running for a timed shutdown.

Log in to Mac|Life directly or log in using Facebook

Forgot your username or password?
Click here for help.

Login with Facebook
Log in using Facebook to share comments and articles easily with your Facebook feed.