Linux view the number of physical CPUs, cores, and logical CPUs

created at 11-16-2021 views: 2

error

# Total number of cores = number of physical CPUs X number of cores per physical CPU
# Total number of logical CPUs = number of physical CPUs × number of cores per physical CPU × number of hyperthreads

# View the number of physical CPUs
cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l

# View the number of cores in each physical CPU (that is, the number of cores)
cat /proc/cpuinfo| grep "cpu cores"| uniq

# View the number of logical CPUs
cat /proc/cpuinfo| grep "processor"| wc -l

View CPU information (model)

cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c

View memory information

cat /proc/meminfo

How to view the Linux kernel

uname -a
cat /proc/version

View the machine model (machine hardware model)

dmidecode | grep "Product Name"
dmidecode

How to check the linux system version

cat /etc/redhat-release
lsb_release -a
cat /etc/issue

How to check the linux system and CPU model, type and size

cat /proc/cpuinfo

How to view the memory size of the Linux system, you can view the total memory, remaining memory, available memory and other information

cat /proc/meminfo
created at:11-16-2021
edited at: 11-16-2021: