```bash
#!/bin/bash
# 检查是否有 root 权限,因为 cpupower 操作需要 root 权限
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root"
exit 1
fi
# 启用所有 CPU 核心(假设当前有部分核心被关闭)
cpupower -c all frequency-set -u $(cpupower -c 0 frequency-info | grep "maximum frequency" | awk '{print $4}')
echo "All CPU cores are now enabled and set to maximum frequency"
在这里插入代码片
