Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

check %cpu on specific process

Status
Not open for further replies.

hokky

Technical User
Nov 9, 2006
170
AU
Hi guys,

I need to check how many %CPU that my script using ?

I've tried :
Code:
top | grep -i myscript

I doesn't return anything. Any idea why ? Thanks guys.
 
Hi

On kind of [tt]top[/tt] or what system ?

My [tt]top[/tt] (procps version 2.0.7) has a -b command line parameter, meeaning batch mode, useful if [tt]top[/tt]'s output is piped to other application. The -n parameter is also useful, you can limit the noumber of outputs before [tt]top[/tt] exits.

Look at your [tt]top[/tt]'s man page. Maybe it has the above parameters, or something even better.

Feherke.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top