TrumanWong

lscpu

Display information about the CPU architecture

Supplementary instructions

lscpu command displays information about the CPU architecture.

grammar

lscpu [options]

Options

  -a, --all #Print online and offline CPU (default is -e)
  -b, --online #Only print online CPU (default value of -p)
  -c, --offline # Print offline CPU
  -e, --extended[=<list>] # Print out an extended human-readable format
  -p, --parse[=<list>] # Print out parsable format
  -s, --sysroot <dir> # Use the specified directory as the system root directory
  -x, --hex # Print hex mask instead of CPU list

  -h, --help # Show this help and exit
  -V, --version # Output version information and exit

Parameters

Available columns:
            CPU logical CPU number
           CORE logical core number
         SOCKET logical socket number
           NODE logical NUMA node number
           BOOK logical book number
          CACHE shows how caches are shared between CPUs
   POLARIZATION CPU scheduling mode on virtual hardware
        ADDRESS Physical address of CPU
     CONFIGURED Shows whether the hypervisor allocated the CPU
         ONLINE Shows whether Linux is using the CPU

example

[root@localhost ~]# lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 4
On-line CPU(s) list: 0-3
Thread(s) per core: 1
Core(s) per socket: 4
Socket(s): 1
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 30
Model name: Intel(R) Xeon(R) CPU X3430 @ 2.40GHz
Stepping: 5
CPU MHz: 2394.055
BogoMIPS: 4788.11
Virtualization: VT-x
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 8192K
NUMA node0 CPU(s): 0-3
# Check the core number corresponding to the CPU number and distinguish whether it is a large core or a small core.
[root@localhost ~]# lscpu -e
CPU NODE SOCKET CORE L1d:L1i:L2:L3 ONLINE MAXMHZ MINMHZ
0 0 0 0 0:0:0:0 is 3600.0000 800.0000
1 0 0 1 1:1:1:0 is 3600.0000 800.0000
2 0 0 2 2:2:2:0 is 3600.0000 800.0000
3 0 0 3 3:3:3:0 is 3600.0000 800.0000
4 0 0 0 0:0:0:0 is 3600.0000 800.0000
5 0 0 1 1:1:1:0 is 3600.0000 800.0000
6 0 0 2 2:2:2:0 is 3600.0000 800.0000
7 0 0 3 3:3:3:0 is 3600.0000 800.0000