LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 12-01-2006, 05:47 AM   #1
meniscus
Member
 
Registered: May 2006
Posts: 70

Rep: Reputation: 15
CPU usage


Someone told me the following line to get the CPU temperature from the hardware monitoring command "sensors"

Code:

sensors | perl -ne 'if ( /CPU Temp:\s*\+(\d+)/ ) { print $1 . "\n"; }'



Im trying to get the the command line to show me just the CPU usage from the command "top"


Code:

top | perl ...............


I dont know what the code given to me means so cant modify it. Can anyone explain?








(This was received in another thread so i hope im not committing the crime of duplication here!
Its just that other thread gave me such cronic grief i gave up on it and hope to start afresh..)
 
Old 12-01-2006, 06:09 AM   #2
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
You could try this:
Code:
top -n 1 |grep Cpu
There are probably better ways to get CPU usage than top though - top is quite heavy itself. One good measure of system load is the load average. See the uptime manual page.

I guess you're trying to write a system monitor eh? There are a lot already out there - maybe you can find some tips on how best to gather system info from their code. I like the name of this one.
 
Old 12-01-2006, 06:47 AM   #3
meniscus
Member
 
Registered: May 2006
Posts: 70

Original Poster
Rep: Reputation: 15
Yes. Thanks for that link. I didnt know there was a comprehensive one for linux.

Ive used speedfan and systems monitor in windows. Im tryin to get a similiar one up and running. Are ther any other good ones you know in linux?
 
  


Reply



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
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
Controlling CPU usage & memory usage Saravana babu Linux - Software 0 02-18-2004 05:55 AM
CPU Usage Jehos Programming 3 11-30-2003 05:46 AM
cpu usage Aldebaran Linux - Newbie 3 10-11-2003 11:57 AM

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

All times are GMT -5. The time now is 10:55 PM.

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