LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   CPU usage (https://www.linuxquestions.org/questions/linux-newbie-8/cpu-usage-359742/)

Volcano 09-03-2005 01:55 AM

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

dinolinux 09-03-2005 02:11 AM

For graphical interface use ksysguard. If you want text or console based, try top

firedance 09-03-2005 02:11 AM

I think top is the command you are looking for.
- aghh dinolinux was faster than me! -

Volcano 09-03-2005 02:18 AM

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 ?

b0nd 09-03-2005 07:03 AM

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

addy86 09-03-2005 10:05 AM

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.

Volcano 09-07-2005 12:21 AM

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

Volcano 09-07-2005 12:26 AM

http://img370.imageshack.us/my.php?i...eenshot3xi.png

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


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