Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 06-16-2011, 07:47 PM   #1
LQ Newbie
Registered: Nov 2010
Location: vadgaon
Posts: 12

Rep: Reputation: 0
check overall cpu usage

Dear all,

I wonder to know the command or the procedure to get the overall CPU utilisation in linux. I have used top, iostat, mpstat but the outputs are not the way i needed. Is it possible to get the output like...

CPU usage: .....% or something like that.

Thanks in advance.

Old 06-16-2011, 08:45 PM   #2
Senior Member
Registered: May 2006
Distribution: Caldera, CTOS, Debian, FreeBSD, Mac OS X, Mandrake, OpenBSD, Slackware, Solaris, SuSE, Xubuntu
Posts: 1,757

Rep: Reputation: 80
Found this script Calculating CPU Usage from /proc/stat; saved it to a file, made it executable, and it worked.
Old 06-16-2011, 11:49 PM   #3
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914
Originally Posted by bsdunix View Post
Found this script Calculating CPU Usage from /proc/stat; saved it to a file, made it executable, and it worked.
It will give skewed results, though; he iterates over the entire line
"^cpu" and adds up values. Only the first 4 are actually relevant,
there's no point in adding softirq, irq, steal and such to the CPU.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
generate snmp trap to check High CPU Usage...... dashang.trivedi Linux - Networking 2 03-17-2011 02:51 AM
processes/CPU Usage/Mem Usage desktop wallpaper ceantuco Linux - Newbie 2 04-13-2009 01:14 PM
How to check the CPU usage in solaris? sunram Solaris / OpenSolaris 7 11-19-2008 02:02 PM
getting realtime info on memory usage-cpu and harddrive usage steering Linux - Newbie 5 03-03-2005 08:43 PM
how to determine cpu usage, memory usage, I/O usage by a particular user logged on li rags2k Programming 4 08-21-2004 04:45 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:04 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration