Linux : how to view CPU info and its usage details

i would like to see a consolidated report of the CPU like

How many CPU's, Cores per Each.
utilization details in one-go command.

Can you please help me getting details
mac_gAdmin - Oracle Fusion Middleware suiteAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Mohamed MagdyCTOCommented:
You can get the details from cpuinfo

cat /proc/cpuinfo

Open in new window


about the utilization you may use 3rdparty program like atop
mac_gAdmin - Oracle Fusion Middleware suiteAuthor Commented:
the above command gives vast info.

However, I want to see only those details in 2 lines what I requested.
Mohamed MagdyCTOCommented:
If you want custom details then you have to use some code to do so like grep, awk, sed.

for example:

grep processor /proc/cpuinfo | tail -n 1 | awk {' print $3 '}

Open in new window

Check Out How Miercom Evaluates Wi-Fi Security!

It's not just about Wi-Fi connectivity anymore. A wireless security breach can cost your business large amounts of time, trouble, and expense. Plus, hear first-hand from Miercom on how WatchGuard's Wi-Fi security stacks up against the competition plus a LIVE demo!

Zephyr ICTCloud ArchitectCommented:
There's also "lscpu" for a more human readable form, it's not 2 lines though...

If you want to see cpu use per core I would use the "top" command and then press "1", you should see the usage/core there.

Then there's also "mpstat" (with a command like "mpstat -P ALL 1") but you might need to install it, it will calculate the average use per core.
mac_gAdmin - Oracle Fusion Middleware suiteAuthor Commented:
am getting below details for mpstat -p ALL 1
can you explain me  what each column signifies
---------------------------------------------------------
09:24:49 AM  CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest   %idle
09:24:50 AM  all    0.00    0.25    0.00    0.00    0.00    0.00    0.00    0.00   99.75
09:24:50 AM    0    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00
09:24:50 AM    1    0.00    0.99    0.99    0.00    0.00    0.00    0.00    0.00   98.02
09:24:50 AM    2    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00
09:24:50 AM    3    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00

------------------------
Zephyr ICTCloud ArchitectCommented:
Your system, at the time of measuring seemed to be idling, I'll sum the meaning of the columns up here, most speak for themselves:

%user:  Show  the percentage of CPU utilization that occurred while executing at the user level (application).

%nice:   Show the percentage of CPU utilization that occurred while  executing at the user level with nice priority.

%system:   Show  the percentage of CPU utilization that occurred while executing at the system level (kernel). Note  that  this  does  not include the time spent servicing interrupts or softirqs.

%iowait:   Show  the percentage of time that the CPU or CPUs were idle during which the system had an outstanding disk I/O request.

%irq:    Show the percentage of time spent by the CPU or CPUs to  service interrupts.
 
%soft:  Show  the percentage of time spent by the CPU or CPUs to service softirqs.  A softirq (software interrupt) is one  of  up  to  32 enumerated software interrupts which can run on multiple CPUs at once.

%steal :  Show the percentage of time spent in involuntary wait by the virtual CPU or CPUs while the hypervisor was servicing another virtual processor

%guest : Show the percentage of time spent by the CPU or CPUs to run a virtual processor

%idle:  Show the percentage of time that the CPU or CPUs were  idle  and the system did not have an outstanding disk I/O request.
 

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
gheistCommented:
You know CPU clocks scale, then you have turbo mode once surplus cores get parked... And that percentile is not linear ...
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux OS Dev

From novice to tech pro — start learning today.