Dit deel is nog niet vertaald. Je ziet de Engelse tekst.
Wat het doet
lscpu collects CPU data from /proc/cpuinfo and /sys. Useful lines: CPU(s), Thread(s) per core, Core(s) per socket, Socket(s), Model name, Hypervisor vendor, Virtualization, and the Vulnerability lines (Spectre, Meltdown …) with their mitigation status.
Zo schrijf je het
lscpu [OPTION]...Opties 15
Meest gebruikt
Niets past bij dit filter.
Voorbeelden 10
$ als gewone gebruiker# als root (of met sudo)
1CPU overview
lscpu Architecture: x86_64 CPU(s): 2 Model name: Intel Xeon Processor (Icelake) Hypervisor vendor: KVMPlus sockets, cores, caches, flags.
2Cores and threads
lscpu | grep -E '^(CPU\(s\)|Thread|Core|Socket)'CPUs = sockets × cores × threads.
3Is this a VM?
lscpu | grep -i hypervisor Hypervisor vendor: KVMNo line = physical machine.
4Can it run VMs?
lscpu | grep -i virtualizationVT-x or AMD-V needed for KVM.
5CPU security mitigations (security)
lscpu | grep -i vulnerab Vulnerability Spectre v2: Mitigation; Enhanced / Automatic IBRS"Vulnerable" lines need a kernel or microcode update.
6Per CPU table
lscpu -eWhich CPU is on which core and socket.
7Caches
lscpu -CL1, L2, L3 sizes.
8JSON for inventory
lscpu -J | jq -r '.lscpu[] | select(.field=="Model name:") | .data'Model for an asset list.
9CPU flags (like AES or AVX)
Does the CPU support hardware AES?
10Compare with nproc
nproc = usable now, lscpu = present.
Niets past bij dit filter.
Exitcodes
0 :: Done. 1 :: Error.