← 返回命令列表

Linux command

cpufreq-set 命令

安全

权限或系统影响较大,执行前请核对目标。

常用示例

Set the frequency governor

sudo cpufreq-set -c [1] -g [performance]

Set the minimum frequency

sudo cpufreq-set -c [1] -d [800MHz]

Set the maximum frequency

sudo cpufreq-set -c [1] -u [2.4GHz]

Pin to a specific frequency

sudo cpufreq-set -c [1] -f [2000MHz]

Apply settings to all CPUs sharing the policy

sudo cpufreq-set -r -g [powersave]

说明

cpufreq-set modifies the Linux kernel cpufreq policy for a CPU, adjusting the scaling governor, minimum and maximum frequencies, or pinning a fixed frequency. It is part of the cpufrequtils package. Frequency values accept the suffixes `Hz`, `kHz` (default if no unit given), `MHz`, `GHz`, and `THz` appended directly to the number (for example `2400MHz` or `2.4GHz`). Valid values for the current CPU can be discovered with `cpufreq-info -l`.

参数

-c, --cpu _cpu_
CPU number to operate on. Defaults to CPU 0 when omitted.
-d, --min _freq_
Set the minimum frequency the governor may select.
-u, --max _freq_
Set the maximum frequency the governor may select.
-g, --governor _governor_
Select the scaling governor (e.g. `performance`, `powersave`, `ondemand`, `conservative`, `schedutil`, `userspace`).
-f, --freq _freq_
Pin the CPU to a specific frequency. Requires the `userspace` governor and cannot be combined with `-d`, `-u`, or `-g`.
-r, --related
Also apply the change to every CPU hardware-related to the selected one.
-h, --help
Show help.

FAQ

What is the cpufreq-set command used for?

cpufreq-set modifies the Linux kernel cpufreq policy for a CPU, adjusting the scaling governor, minimum and maximum frequencies, or pinning a fixed frequency. It is part of the cpufrequtils package. Frequency values accept the suffixes `Hz`, `kHz` (default if no unit given), `MHz`, `GHz`, and `THz` appended directly to the number (for example `2400MHz` or `2.4GHz`). Valid values for the current CPU can be discovered with `cpufreq-info -l`.

How do I run a basic cpufreq-set example?

Run `sudo cpufreq-set -c [1] -g [performance]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -c, --cpu _cpu_ do in cpufreq-set?

CPU number to operate on. Defaults to CPU 0 when omitted.