Auto-sync: 2026-04-17 08:37

This commit is contained in:
2026-04-17 08:38:12 +08:00
parent 6caa1c2f47
commit a0a48bd334
247 changed files with 6577 additions and 3061 deletions

48
wiki/concepts/pmset.md Normal file
View File

@@ -0,0 +1,48 @@
---
title: "pmset"
type: concept
tags: [macos, power-management, command-line]
date: 2026-04-17
---
## Definition
pmset 是 macOS 的电源管理命令行工具,用于查询和修改系统睡眠、显示器关闭、待机模式等电源相关设置。
## Usage
```bash
# 查看当前电源设置
pmset -g
# 禁止系统睡眠
sudo pmset -a sleep 0
# 禁止显示器关闭
sudo pmset -a displaysleep 0
# 禁止待机模式
sudo pmset -a standby 0
# 禁止休眠
sudo pmset -a hibernatemode 0
# 启用网络唤醒
sudo pmset -a womp 1
```
## Parameters
| 参数 | 作用 |
|------|------|
| `-a` | 应用于所有电源模式(电池和电源适配器) |
| `-b` | 仅电池模式 |
| `-c` | 仅电源适配器模式 |
| `sleep` | 系统睡眠时间分钟0 为禁止) |
| `displaysleep` | 显示器关闭时间分钟0 为禁止) |
| `standby` | 待机模式0 为禁止) |
| `hibernatemode` | 休眠模式0 为禁止) |
| `womp` | 网络唤醒1 为启用0 为禁用) |
## Related Concepts
- [[caffeinate]]:临时保持唤醒的工具
- [[WOL (Wake on LAN)]]:网络唤醒功能
- [[休眠 (Hibernate)]]:内存数据写入磁盘后完全断电
- [[待机 (Suspend)]]:内存保持供电的低功耗睡眠状态