LinuxQuestions.org
Help answer threads with 0 replies.
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 09-03-2005, 02:55 AM   #1
Volcano
Member
 
Registered: Sep 2005
Posts: 172

Rep: Reputation: 15
CPU usage


Objective :

how do i get the CPU usage of the linux machine ?



do i need to write any C/C++ code for this

OR

there is some shell command for this ? whats is that and how do i run it ?

thank you

System : Red hat linux
 
Old 09-03-2005, 03:11 AM   #2
dinolinux
Member
 
Registered: Jun 2005
Location: Oslo, Norway
Distribution: Slackware 11, Solaris 10, Solaris 9, Sourcemage 0.9.6
Posts: 322

Rep: Reputation: 31
For graphical interface use ksysguard. If you want text or console based, try top
 
Old 09-03-2005, 03:11 AM   #3
firedance
Member
 
Registered: Dec 2003
Location: Sweden
Distribution: Arch Linux
Posts: 65

Rep: Reputation: 15
I think top is the command you are looking for.
- aghh dinolinux was faster than me! -
 
Old 09-03-2005, 03:18 AM   #4
Volcano
Member
 
Registered: Sep 2005
Posts: 172

Original Poster
Rep: Reputation: 15
mmm...confused.

i dont want graphical interface.

i would be happy, if i can capture CPU usage data in a log.txt file.

what is the command or what i should do ?

"top" just this is the command . if i type "top" will i get the data in a txt file ?

i need the datafile because i am interested to use that data file in another program.


Please can you explain more how do i solve this problem ?
 
Old 09-03-2005, 08:03 AM   #5
b0nd
Senior Member
 
Registered: Jan 2005
Distribution: Slackware, BackTrack, Windows XP
Posts: 1,020

Rep: Reputation: 45
if you do
root # top >> log.txt
its sending the data of "top" command in "log.txt"...........now see how you can use it

regards
 
Old 09-03-2005, 11:05 AM   #6
addy86
Member
 
Registered: Nov 2004
Location: Germany
Distribution: Debian Testing
Posts: 332

Rep: Reputation: 31
Quote:
Originally posted by ruudra
if you do
root # top >> log.txt
its sending the data of "top" command in "log.txt"...........now see how you can use it

regards
1.) This doesn't work. Instead, use: top -b
2.) Never, I repeat, never use the name of root if you do not absolutely have to.
 
Old 09-07-2005, 01:21 AM   #7
Volcano
Member
 
Registered: Sep 2005
Posts: 172

Original Poster
Rep: Reputation: 15
top comand is working but i want the overall CPU usage . when i System Monitor , i found different CPU usage than using top command.

i want the CPU usage shown by the System Monitor . thats is a overall CPU usage.

how can i get that data ?

regards
Volcano
 
Old 09-07-2005, 01:26 AM   #8
Volcano
Member
 
Registered: Sep 2005
Posts: 172

Original Poster
Rep: Reputation: 15
http://img370.imageshack.us/my.php?i...eenshot3xi.png

here you will see the overall CPU usage data. can i get that data ?
 
  


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
Get CPU Usage ramicub Programming 3 11-02-2010 05:34 AM
getting realtime info on memory usage-cpu and harddrive usage steering Linux - Newbie 5 03-03-2005 09: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 05:45 AM
Controlling CPU usage & memory usage Saravana babu Linux - Software 0 02-18-2004 06:55 AM
CPU Usage Jehos Programming 3 11-30-2003 06:46 AM


All times are GMT -5. The time now is 10:48 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration