shell program to find a process load
I need to find the CPU load being used by a particular process,say for example "java".Also i need to write that process's load to a file. i used the following command:
Quote:
|
Code:
top | grep java |
add " | grep java > newfilename"
|
Let me try and will get u back Dudes.
|
Have a look at the top man page. Specifically regarding the -b flag for batch mode.
Evo2. |
what about
root#top -b -d 5 -p <pid of process> -b -> in batch mode -d-> Delay Thanks |
I tried with
Quote:
Quote:
|
Quick and dirty with awk:
Code:
top -b -n 1 | grep Xorg | awk '{ print $9 }' |
Thank u Evo. I got it...
|
All times are GMT -5. The time now is 01:43 PM. |