Checking CPU info on Linux has three quick commands: lscpu for a summary, /proc/cpuinfo for per-core detail, and nproc for the count. The team that wants to know how many cores do I have? runs nproc. The team that wants model, frequency, cache sizes runs lscpu. The team that wants flags (avx, aes, sse) per core greps /proc/cpuinfo.
Table of contents
- lscpu: the summary view
- /proc/cpuinfo: per-core detail
- nproc: just the count
- dmidecode: hardware-level detail
- Frequency scaling
- FAQ
lscpu: the summary view
lscpu
Output includes:
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 8
On-line CPU(s) list: 0-7
Thread(s) per core: 2
Core(s) per socket: 4
Socket(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 158
Model name: Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
CPU MHz: 2000.000
CPU max MHz: 4000.0000
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 8192K
Flags: fpu vme de pse tsc msr ...
That single command answers 90% of CPU-info questions.
/proc/cpuinfo: per-core detail
cat /proc/cpuinfo
Each logical CPU (including hyperthreaded siblings) gets a block. The team that has 8 cores with 2 threads each sees 16 blocks.
Filter to a specific core:
grep -A 5 "processor\s*: 0" /proc/cpuinfo
Find a specific flag (e.g., AES-NI for crypto):
grep -o aes /proc/cpuinfo | sort -u
The team that uses grep on /proc/cpuinfo finds specific flags faster than parsing lscpu.
nproc: just the count
nproc
# Output: 8
nproc returns the number of processing units available to the current process. The team that uses this in scripts to set make -j$(nproc) has the right pattern for parallel builds.
dmidecode: hardware-level detail
sudo dmidecode -t processor
dmidecode reads the SMBIOS data from the BIOS and shows the actual hardware - including socket type, max TDP, and the manufacturing date. The team that wants to verify the physical CPU model (not just what Linux sees) uses this.
Frequency scaling
The actual CPU frequency varies based on load and the governor:
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
performance keeps the CPU at max freq always. powersave scales down under low load. ondemand (older) and schedutil (newer) scale based on heuristics.
The team that sees the CPU at 800 MHz under load has a powersave governor that’s not scaling up - fix with sudo cpufreq-set -g performance (or the modern equivalent: sudo cpupower frequency-set -g performance).
FAQ
What is the difference between CPU(s) and Core(s) per socket?
CPU(s) is the total logical processors visible to the OS. Core(s) per socket is the physical cores per physical CPU package. With hyperthreading, CPU(s) = sockets * cores * threads_per_core. The team that sees 8 CPU(s), 4 cores, 2 threads has a 4-core CPU with hyperthreading.
How do I check if AES-NI is available?
grep -o aes /proc/cpuinfo | head -1. The team that sees aes in the flags has hardware AES acceleration. The team that sees nothing should enable it in the BIOS or use a different CPU.
Why does the model name not match what I ordered?
Cloud providers sometimes run older or different CPUs than the marketing name suggests. The team that uses lscpu to verify the actual model catches this - it matters for workloads that depend on specific instruction sets.
Can I see NUMA topology?
lscpu shows NUMA nodes. numactl --hardware shows per-node memory and distance. The team that runs latency-sensitive workloads on multi-socket systems uses this to pin processes to the right NUMA node.
How do I see CPU temperature?
sensors from the lm-sensors package. Run sudo sensors-detect first to detect the chip. The team that monitors CPU temp has a heads-up on thermal throttling - usually only relevant on bare metal, not cloud.
If you are sizing the infrastructure for the kind of project this post covers, the RunxBuild hosting calculator is the right place to model the line items. The compute, the memory, the storage, the bandwidth, the database - each one is a separate number, and the team’s mental model for the platform is the sum of those numbers. The RunxBuild dashboard is where the team sees the actual usage in one place.
Useful related references: