Search Articles

Top 10 Commands to Check CPU Information on Linux

CPU info includes detailed information about the processor, like it's architecture, vendor name, model, number of cores, speed of each core etc. In Linux, there are many command line or GUI-based tools that can be used to show detailed information about your CPU hardware, however we are exploring some of the best and useful commands using which you can get much more detailed information about Linux CPU.

Get CPU info using /proc/cpuinfo on Linux

Linux /proc/cpuinfo file contains details about individual cpu cores. Proc (/proc) file system provides information about CPU and their speed which is a pseudo-filesystem. It is used as an interface to kernel data structures. It is commonly mounted at /proc. You can use command like more, less or grep to see the contents of this file.

Commands to Get CPU Details on Linux


$ less /proc/cpuinfo
siblings        : 16
core id         : 0
cpu cores       : 8
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 sse4_2 x2apic popcnt aes xsave avx f16c rdrand lahf_lm ida arat xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms
bogomips        : 5199.62
clflush size    : 64
cache_alignment : 64
address sizes   : 46 bits physical, 48 bits virtual
power management:
processor       : 1
vendor_id       : GenuineIntel
cpu family      : 6
................ etc

You can also get details using more and cat command like:
$ more /proc/cpuinfo
$ cat /proc/cpuinfo


To display number of processors in the system
Every processor or core is listed separately and the various details about speed, cache size and model name are included in the description. To count the number of processing units use grep command with wc.
$cat /proc/cpuinfo | grep processor | wc -l
32
$ grep processor /proc/cpuinfo 
processor       : 0
processor       : 1
processor       : 2
processor       : 3
processor       : 4
processor       : 5
processor       : 6
processor       : 7
processor       : 8
........... ...........
processor       : 29
processor       : 30
processor       : 31 

Note: The number of processors shown by /proc/cpuinfo might be different from the actual number of cores on the processor. For example a processor with 2 cores and hyperthreading would be reported as a processor with 4 cores.


To get the actual number of cores, check the core id for unique values
$ cat /proc/cpuinfo | grep 'core id'
$ cat /proc/cpuinfo | grep 'core id'| wc -l
32


lscpu
lscpu is a small and quick command that does not need any options. It would simply print the cpu hardware details in a human readable format.
$ lscpu


To Find CPU vendor 
If you’re interested in just knowing the CPU vendor, go with cat /proc/cpuinfo along with with the grep command.
$ cat /proc/cpuinfo | grep vendor | uniq
vendor_id       : GenuineIntel


To Find Model Name
$ cat /proc/cpuinfo | grep 'model name' | uniq
model name      : Intel(R) Xeon(R) CPU E5-2650 v2 @ 2.60GHz


Hardinfo 
Hardinfo is a gtk based gui utility that generates reports about various hardware components including memory, storage, PCI devices, storage, USB devices etc plus information on the OS, kernel, and networking. But it can also run from the command line only if there is no gui display available.

To install hardinfo
If hardinfo is not installed on your Linux box, you can do so with the following command on your Ubuntu system.
$ sudo apt-get install hardinfo
Let's Look into this command
$ hardinfo | less
It would produce a large report about many hardware parts, by reading files from the /proc directory. The cpu information is towards the beginning of the report. The report can also be written to a text file. Hardinfo also performs a few benchmark tests taking a few minutes before the report is displayed.


To find the number of processing units available
 The nproc command just prints out the number of processing units available. Note that the number of processing units might not always be the same as number of cores.
$ nproc
4


To Display name of the Operating System.
$ uname -a
Linux 2.6.39-400.215.10.el5uek #1 SMP Tue Sep 10 22:51:46 PDT 2014 x86_64 x86_64 x86_64 GNU/Linux


Inxi
 One of my all time favorite command line tools and I have it running on all my Linux systems. This is an excellent script that provides information in an easy to understand format.

To install Inix on Ubuntu
$ sudo apt-get install inxi

To install Inix on CentOS/Fedora
$ sudo yum install inxi

Print out cpu/processor related information 
$ inxi -C


dmidecode
The dmidecode command displays some information about the cpu, which includes the socket type, vendor name and various flags. Following command with type id 4 will get the information about CPU of the system.
# dmidecode -t 4
# dmidecode 2.9
$sudo demidecode -t processor
$ sudo dmidecode -t 4
Get BIOS information using dmidecode
# dmidecode -t bios
# dmidecode 2.9
View Manufacturer, Model and Serial number of the equipment using dmidecode
# dmidecode -t system
# dmidecode 2.9


cpuid
The cpuid command fetches CPUID information about Intel and AMD x86 processors.

This program can be installed with apt on ubuntu
$ sudo apt-get install cpuid

To install cpuid on Fedora and CentOS distributions.
$ sudo yum install cpuid

And here is sample output
$ cpuid

Run the command with less to get a readable output.
$ cpuid | less


You can also do R&D with grep command to find more cpu info in Linux/Unix. From the readers, your comment is valuable to us. Please share if you have more valuable commands to get more detailed output.


Other similar sources:

nixCraft: Number of CPUs and Their Speed
redhax: /proc/cpuinfo.html
linuxquestions.org
Read more ...

ORA-27211: Failed to load Media Management Library

RMAN backup failed With below error:

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of allocate command on ch1 channel at 06/20/2015 09:17:05
ORA-19554: error allocating device, device type: SBT_TAPE, device name:
ORA-27211: Failed to load Media Management Library
Additional information: 4005


How to fix ORA-19554 and ORA-27211 errors?


CAUSE:

Before using RMAN with a media manager, media management software must be installed and configured on the target host or production network.

When allocating or configuring channels for RMAN to use to communicate with a media manager, specify the SBT_LIBRARY parameter to provide the path to the media management software library. When RMAN allocates channels to communicate with a media manager, it attempts to load the library indicated by the SBT_LIBRARY parameter.

If you do not provide a value for this parameter, RMAN looks in a platform-specific default location. On Linux/UNIX, the default library filename is $ORACLE_HOME/lib/libobk.so, with the extension name varying according to platform: .so, .sl, .a, and so on. On Windows the default library location is %ORACLE_HOME%\bin\orasbt.dll.

If the database is unable to locate a media management library in the location specified by the SBT_LIBRARY parameter or the default location, then RMAN issues an ORA-27211 error and exits.


Resolving "Failed to load Media Management Library" Issue

Link libobk.so to your backup vendor supplied rman library using symbolic link.

Go to <ORACLE_HOME/lib/> directory.

$ pwd
/ora/app/oracle12c/product/12.1.0.2/dbhome_1/lib
$ cd  /usr/openv/netbackup/bin
$ ls -ltr libobk.so64
-r-xr-xr-x 1 root bin 1567895 Jun  20  2015 libobk.so64

$ cd /ora/app/oracle12c/product/12.1.0.2/dbhome_1/lib
$ ln -s /usr/openv/netbackup/bin/libobk.so64 libobk.so
$ ls -ltr libobk.so
lrwxrwxrwx 1 oracle dba 36 Jun 20 09:27 libobk.so -> /usr/openv/netbackup/bin/libobk.so64

Now start backup, if it gets completed successfully then no issues, if fail again then create below link in the same location as above.

$ ln -s /usr/openv/netbackup/bin/libobk.so64 libobk.a
$ ln -s /usr/openv/netbackup/bin/libobk.so64 libobk.so64
$ ls -lrt libobk*
lrwxrwxrwx 1 oracle dba 36 Jun 20 09:45 libobk.so -> /usr/openv/netbackup/bin/libobk.so64
lrwxrwxrwx 1 oracle dba 36 Jun 20 10:00 libobk.a -> /usr/openv/netbackup/bin/libobk.so64
lrwxrwxrwx 1 oracle dba 36 Jun 20 10:00 libobk.so64 -> /usr/openv/netbackup/bin/libobk.so64


For "ORA-19554: error allocating device, device type: SBT_TAPE" 
and "ORA-27211: Failed to load Media Management Library" you can get more info at: Backup and Recovery

Read more ...

CONTACT

Name

Email *

Message *