How To Automatically Shutdown Your MacBook, iMac, Unix or Linux Computer

Imagine you are going to bed soon but the file you are downloading will take three more hours to complete. You wish to shutdown your computer after three hours, but by then you will be in bed. What are you going to do?

A) Wake up and switch it off three hours later, or 

B) Program it to shutdown automatically three hours later.

Today, I am going to teach you how to do B) with grace and style. (No need to install any software.) This is only applicable to MacBooks, iMacs, Linux or Unix computers. First you must have root access to the machine.

Step 1

Launch the Terminal application.

Step 2

Execute this command: sudo shutdown -h M. M is the number of minutes before shutdown. For example, sudo shutdown -h 180 will shutdown the computer three hours later (3 x 60 = 180 minutes).

Alternatively, if you want to shutdown your computer at a specific time (e.g., 3a.m.) then replace M with 03:00 (the time in the 24 hour clock), for example, sudo shutdown -h 03:00.

Note that root password is required. You will be prompted to enter the password after you entered the above command.

Step 3

Leave the terminal open. Do not shut the window, you can minimize it. Now, you are done!

With this little tip, you can ensure that your machine will shutdown at exactly the time you want, no matter where you are or what you do.


Share this article!

Follow us!

Find more helpful articles: