LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 01-24-2007, 05:20 AM   #1
Rohan Nakar
LQ Newbie
 
Registered: Jan 2007
Location: India
Distribution: FC4
Posts: 2

Rep: Reputation: 0
Post CPU usage from /proc/stat


Hi to all,
I am using FC4. I am trying to get the CPU usage from /proc/stat file.
But, when i open that file it shows me something like this:

Code:
cpu  106700 2292 18844 1751815 112658 2865 0 0
cpu0 106700 2292 18844 1751815 112658 2865 0 0
intr 23031711 19954800 36850 0 1 1 0 1 4 1 1353 64792 4 2711756 0 88272 173876
ctxt 6934764
btime 1169615882
processes 7442
procs_running 1
procs_blocked 0
Can anyone tell me how to know CPU usage from this information.
I know that there are several other ways to do it but I want to do it using this file only.

Any help ?

Thanks in advance.
 
Old 01-24-2007, 05:26 AM   #2
varun_shrivastava
Member
 
Registered: Jun 2006
Distribution: Ubuntu 7.04 Feisty
Posts: 79

Rep: Reputation: 15
to see cpu usage use top command

do a "man top" to get more details
 
Old 01-24-2007, 05:32 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,119

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
"man proc"
 
Old 01-25-2007, 12:49 AM   #4
Rohan Nakar
LQ Newbie
 
Registered: Jan 2007
Location: India
Distribution: FC4
Posts: 2

Original Poster
Rep: Reputation: 0
Angry

Quote:
to see cpu usage use top command

do a "man top" to get more details
Hey varun, I think you haven't read my post.
Quote:
I know that there are several other ways to do it but I want to do it using this file only.
Please reaad the entire post before replying...

Thank syg00, i'll go through it...
 
  


Reply


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
/proc/stat file problem for cpu usage arunka Programming 3 04-23-2014 01:08 PM
/proc/<pid>/stat shows zero cpu usage simchac Linux - Kernel 0 07-25-2006 07:26 AM
/proc/stat cpu info GDarkBladE Linux - Software 2 10-11-2005 03:16 PM
/proc/stat cpu ahz Programming 1 04-24-2005 07:24 AM
Calculating total %cpu usage from /proc/stat gaijin Programming 1 07-07-2004 02:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:59 AM.

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