On a Linux
system, you can use the lscpu command to obtain information on the system's
Central Processing Unit (CPU). On a
CentOS Linux
system, the utility is included in the util-linux package. On a CentOS system,
you can install that package using the
yum
package management utility, if it isn't already installed, using
yum install util-linux. You can check on whether the
lscpu program is already present using which lscpu and, on
a CentOS system or another system that uses
RPM,
you can use rpm -qi util-linux to determine if the util-linux
package is already installed.
$ which lscpu /usr/bin/lscpu $ rpm -qi util-linux Name : util-linux Version : 2.23.2 Release : 22.el7_1 Architecture: x86_64 Install Date: Sun 12 Jul 2015 09:32:56 AM EDT Group : System Environment/Base Size : 7945942 License : GPLv2 and GPLv2+ and LGPLv2+ and BSD with advertising and Public Domain Signature : RSA/SHA256, Tue 12 May 2015 10:01:12 AM EDT, Key ID 24c6a8a7f4a80eb5 Source RPM : util-linux-2.23.2-22.el7_1.src.rpm Build Date : Tue 12 May 2015 09:43:21 AM EDT Build Host : worker1.bsys.centos.org Relocations : (not relocatable) Packager : CentOS BuildSystem <http://bugs.centos.org> Vendor : CentOS URL : http://en.wikipedia.org/wiki/Util-linux Summary : A collection of basic system utilities Description : The util-linux package contains a large variety of low-level system utilities that are necessary for a Linux system to function. Among others, Util-linux contains the fdisk configuration tool and the login program. $
When you run the program, you will see output similar to that shown below:
$ lscpu Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 2 On-line CPU(s) list: 0,1 Thread(s) per core: 2 Core(s) per socket: 1 Socket(s): 1 NUMA node(s): 1 Vendor ID: GenuineIntel CPU family: 15 Model: 6 Model name: Intel(R) Pentium(R) 4 CPU 3.00GHz Stepping: 5 CPU MHz: 2999.798 BogoMIPS: 5999.59 L1d cache: 16K L2 cache: 2048K NUMA node0 CPU(s): 0,1 $
You can see the options available for the program using lscpu
-h.
$ lscpu -h
Usage:
lscpu [options]
Options:
-a, --all print both online and offline CPUs (default for -e)
-b, --online print online CPUs only (default for -p)
-c, --offline print offline CPUs only
-e, --extended[=<list>] print out an extended readable format
-p, --parse[=<list>] print out a parsable format
-s, --sysroot <dir> use specified directory as system root
-x, --hex print hexadecimal masks rather than lists of CPUs
-h, --help display this help and exit
-V, --version output version information and exit
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 dispatching mode on virtual hardware
ADDRESS physical address of a CPU
CONFIGURED shows if the hypervisor has allocated the CPU
ONLINE shows if Linux currently makes use of the CPU
For more details see lscpu(1).
$There is also a man page, which you can view by issuing the command man lscpu