首頁  >  文章  >  系統教程  >  在 Mac 上安排關機定時器的 3 種方法

在 Mac 上安排關機定時器的 3 種方法

尊渡假赌尊渡假赌尊渡假赌
尊渡假赌尊渡假赌尊渡假赌原創
2024-09-19 02:11:28783瀏覽

3 Ways to Schedule Shutdown Timer on Mac

第 3 步:選擇計畫選項。

3 Ways to Schedule Shutdown Timer on Mac

第 4 步:指定要執行的日期、時間和操作。

第 5 步:最後,點選套用

3 Ways to Schedule Shutdown Timer on Mac

就是這樣。您已成功安排 Mac 在指定時間關閉。如果您覺得這些步驟太長而難以遵循,可以使用一些方便的應用程序,例如計時器時鐘(付費)和 Almighty-強大的調整(免費增值),可以相對輕鬆地完成工作。

也就是說,如果您使用的是 macOS Ventura 或想要在不觸摸「節能器」選項的情況下執行相同操作,請轉到下一個方法。

方法二:使用終端

第1 步:按指令空間 鍵,輸入 終端>終端> ,然後按回傳鍵。

第 2 步:輸入以下指令並按 回車

<span data-preserver-spaces="true">sudo shutdown -h +30</span>

注意:-h 可讓您設定計時器,而 30 是 Mac 將在幾分鐘後關閉。您可以添加任意小時數,但請確保將其轉換為分鐘。 

3 Ways to Schedule Shutdown Timer on Mac

第3步:輸入您的使用者密碼進行驗證,然後按回車

注意:當您輸入密碼時,它不會顯示。

3 Ways to Schedule Shutdown Timer on Mac

給你了。如果您所做的一切正確,終端機將確認並設定您的關機計時器。

3 Ways to Schedule Shutdown Timer on Mac

它也會為行程指派一個行程 ID (PID) 號碼。請記下 ID 號,因為它在關閉關機計時器時很有用。 如果步驟對您來說太複雜,有第三方應用程式可以簡化流程。繼續閱讀。 

方法三:建立桌面捷徑

第1 步:按指令空間 鍵,輸入 然後按回傳鍵。

第 2 步:點選新文件

3 Ways to Schedule Shutdown Timer on Mac

它將開啟一個空白文字文件進入視圖。

第 3 步:按 Command Shift T 存取明文字段。

3 Ways to Schedule Shutdown Timer on Mac

第 4 步:鍵入以下指令,然後按 Return 鍵兩次。

<span data-preserver-spaces="true">#!/bin/bash</span>

3 Ways to Schedule Shutdown Timer on Mac

Step 5: Type the below command.

<span data-preserver-spaces="true">sudo shutdown -h +30</span>

Note: -h lets you set a timer, while +30 is the number of minutes after which your Mac will shut down. You can add any number of hours, but make sure you convert it to minutes. 

3 Ways to Schedule Shutdown Timer on Mac

Step 6: Finally, press Command+S to save the file with a simple name and destination (preferred Desktop). Uncheck the If no extension is provided, use .”txt”. options and click on Save.

3 Ways to Schedule Shutdown Timer on Mac

Now, to make the file executable, continue following the steps below.

Step 7: Press the Command + Space key, type Terminal, and press the Return key.

Step 8: Drag and drop the .txt file you created onto the Terminal and press Return.

3 Ways to Schedule Shutdown Timer on Mac

The terminal will auto-fetch the file location for you to quickly execute.

3 Ways to Schedule Shutdown Timer on Mac

Step 9: Enter your user password and press Return.

Note: When you type your password, it won’t be displayed.

3 Ways to Schedule Shutdown Timer on Mac

After which, the shutdown timer will begin, and your Mac will shut down after the set time.

3 Ways to Schedule Shutdown Timer on Mac

Now that you know how to enable a shutdown timer, it is equally important to know how to disable it. Continue reading.

How to Disable a Shutdown Timer on Mac

Turning off the shutdown timer is easy and only involves a few steps. All you have to do is kill the Process ID (PID). Follow the steps below.

Step 1: Press the Command + Space, type Terminal, and press the Return key.

Step 2: Type the below command and press Return.

<span data-preserver-spaces="true">sudo kill [pid number]</span>

Note: If you don’t remember the PID number, type sudo killall shutdown. It will disable all the active shutdown timers on your Mac.

3 Ways to Schedule Shutdown Timer on Mac

Step 3: Enter your user password and press Return.

Note: When you type your password, it won’t be displayed.

3 Ways to Schedule Shutdown Timer on Mac

There you have it. You have disabled a scheduled shutdown of your Mac. If you have any queries, check out the FAQ section below.

Mac 上定時關機的常見問題解答

1。如果您不關閉 Mac,會發生什麼情況?

只要您經常使用 Mac 並且它處於良好的工作狀態,長時間保持 Mac 開機通常不會有問題。

2。如何在 1 小時後關閉 Mac?

開啟終端機 >輸入 sudo shutdown -h 60 >按回車鍵>輸入您的使用者密碼(不會顯示)>再按回車鍵。就這樣,您已安排關閉。

3。您可以為 Mac 設定睡眠定時器嗎?

是的,您可以在終端機中使用「pmset」命令為 Mac 設定睡眠計時器。但是,您需要擁有管理員權限才能使用 pmset 命令。

第1 步:開啟終端機
第2 步:鍵入指令 sudo pmset sleep [time]

將[🎜>將time] 替換為您要設定計時器的秒數。 第 3 步
:出現提示時輸入密碼,然後按 Return 鍵。
要取消計時器,請依照上述步驟操作並輸入 sudo pmset sleep cancel

。這將取消睡眠定時器,您的 Mac 將保持喚醒狀態。

無論您想設定每日關機定時器還是一次性事件,本文提到的方法都可以幫助您做到。

以上是在 Mac 上安排關機定時器的 3 種方法的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn