终端挂起与休眠系统(systemctl)
用 systemctl suspend 睡眠到内存,用 systemctl hibernate 休眠到磁盘,另有 hybrid-sleep 和 suspend-then-hibernate 变体。
运行 `systemctl suspend` 让电脑进入睡眠,或 `systemctl hibernate` 把内存状态存入 swap 后关机。
01命令
命令
$ systemctl suspend02作用说明
挂起(suspend)保持内存供电,几秒钟即可唤醒;休眠(hibernate)把内存写入 swap、完全断电,笔记本可以存放好几天。可用 `cat /sys/power/state` 查看系统支持哪些状态。`systemctl suspend-then-hibernate` 先睡眠,超过 /etc/systemd/sleep.conf 设置的时长后自动转为休眠,是笔记本省电的好默认值。
03风险
!注意: 休眠要求 swap 不小于内存并正确配置 resume 参数;如果唤醒失败,机器会冷启动,内存中未保存的工作会丢失。
04撤销
✓无需撤销——该命令不会改变持久状态。
05来源
- systemctl(1) - Linux manual page依据: systemctl suspend, hibernate, hybrid-sleep and suspend-then-hibernate put the system into the corresponding power-saving state.
- Suspend and hibernate - ArchWiki依据: Documents suspend-to-RAM vs suspend-to-disk and the swap/resume requirements for hibernation to work.
最后验证: 2026-09-18 · 分类: 系统与设置