CPU 정보 확인 명령어
전체 CPU 정보 확인
$ cat /proc/cpuinfo
논리 코어 수 확인
$ grep -c processor /proc/cpuinfo
물리 CPU 개수 확인
$ grep "physical id" /proc/cpuinfo | sort -u | wc -l
CPU당 물리 코어 수 확인
$ grep "cpu cores" /proc/cpuinfo | tail -1
또는 아래와 같이 간편하게 명령어 하나로도 확인이 가능하다.
$ 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: 58
Model name: Intel(R) Xeon(R) CPU E3-1220 V2 @ 3.10GHz
Stepping: 9
CPU MHz: 3092.880
BogoMIPS: 6185.76
Virtualization: VT-x
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 8192K
NUMA node0 CPU(s): 0-3