### 一、查看自动睡眠状态

````shell
sudo systemctl status sleep.target
````

- Loaded：表示自动睡眠开启

![image-20230709082424627](https://blog-heysq-1255479807.cos.ap-beijing.myqcloud.com/blog/note/image-20230709082424627.png)

### 二、关闭自动睡眠和挂起

```shell
sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
```

![image-20230709082545897](https://blog-heysq-1255479807.cos.ap-beijing.myqcloud.com/blog/note/image-20230709082545897.png)