cpu core command linux

C++
lscpu

#or
cat /proc/cpuinfo
# nprocnproc
# 8
Source

Also in C++: