在 Debian(以及所有 Linux 系统)中,/proc/cpuinfo 是一个文本文件,由内核在运行时生成,用来描述 CPU 的硬件信息。
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 142
model name : Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
stepping : 10
microcode : 0xea
cpu MHz : 800.000
cache size : 6144 KB
physical id : 0
siblings : 8
core id : 0
cpu cores : 4
apicid : 0
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d
processor : 1
vendor_id : GenuineIntel
cpu family : 6
...
| 字段 | 含义 |
|---|---|
processor |
逻辑 CPU 编号(从 0 开始) |
vendor_id |
CPU 厂商(如 GenuineIntel / AuthenticAMD) |
cpu family / model |
CPU 型号族和型号 |
model name |
可读的 CPU 名称 |
cpu MHz |
当前频率 |
cache size |
缓存大小 |
physical id |
物理 CPU 编号 |
siblings |
该物理 CPU 的逻辑核心数 |
core id |
核心编号 |
cpu cores |
物理核心数 |
flags |
CPU 支持的指令集和功能 |
cat /proc/cpuinfo
或只看逻辑 CPU 数量:
nproc
grep -c processor /proc/cpuinfo
如果你需要:
/proc/cpuinfo 的脚本可以继续问。