How to turn off our Mac from Terminal

Thanks to the Terminal application we can make a large number of modifications to our Mac, modifications that are not available natively, either because Apple does not want them to be at our fingertips, or because they have not thought about it. In this article We are going to show you one more use of Terminal, the nth we could say, a trick with which we will be able to turn off our Mac directly from the command line, without having to navigate through the menus. Through Terminal we can find different ways to turn off or schedule the shutdown of our Mac, but in this article we are only going to show you two, at least to all those readers who do not know them.

Shut down our Mac from the command line with "shutdown"

The shutdown command allows us to shut down our Mac from the command line making use of the "-h" property together with the word "now" so that the Mac  request password and automatically process to shutdown. The complete command to be able to turn off our Mac from the command line is: sudo shutdown -h now

Schedule shutdown of our Mac in XX minutes from the command line

As we have seen in the previous section, using the now command we can directly turn off our Mac from Terminal. But if we modify the "now" property by +30, we will configure our Mac so that proceed to power off after 30 minutes. The complete command to program the shutdown of our Mac in 25 minutes would be: sudo shutdown -h +25

Shut down our Mac from Terminal using «halt»

Another command that we can use to turn off our Mac is "halt", a command with which our Mac will proceed to shutdown directly as with the first option that I have shown you in this article. The complete command would be: sudo halt


Leave a Comment

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

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Pedro said

    Or also, to turn off at a specific time (for example, at ten past six): sudo shutdown -h 18:10
    This is pure UNIX.