coolcommands.com - the search engine for unix sysadmins :: unix commands and scripts
Sunday May 19, 2013


 Home
 Search
 Advanced Search
 Category Search
 Affiliates
 Acknowledgements
 Cool Links

Username

Password

Remember me
Forgot your password?

Who's Online
We have 32 guests online

Newest Member

nbewwmbxog

Hit Counter
11537654 Visitors

cool Statistics
coolcommands:1338
Categories:83
Total queries:620082
Members:22813





Search coolcommands.com
Search Keyword:


coolcommand

sumcpu.sh - script to calculate cumulatuve percentage cpu usage for a process(es)
Description

Here is a script which calculates cumulative percentage cpu usage for one or more processes:

#!/bin/sh

if [ $# -ne 1 ]
then
echo "Usage: `/usr/bin/basename $0` string"
echo " string=pattern to grep for"
else
ps -e -o "%C %p %U %x %a" | egrep "$1" | egrep -v "grep|defunct|ps.sh|CPU" | awk '
BEGIN{
cputime=0
}
END{
printf("Cumulative Percentage CPU: %s\n",cputime);
}
{
print $0
cputime=cputime+$1
}'
fi
Example

sumcpu.sh "http|java"

Return to search results

Random coolcommands

coolcommand: how to install enterprise applications by script in Websphere Application Server v5 or v6
Example: installinteractive.sh /path/to/earfile/xx.ear
[show me the details]
coolcommand: lt.pl - how to take perl localtime and display in human readable format
Example: lt.pl
[show me the details]
coolcommand: fw - how to display the status of target hosts in Checkpoint Firewall-1
Example: fw stat
[show me the details]
coolcommand: how to clone partition tables in Sun Solaris
Example: prtvtoc /dev/rdsk/c0t0d0s2 | fmthard -s - /dev/rdsk/c0t1d0s2
[show me the details]

coolcommands.com - the search engine for UNIX sysadmins :: unix commands and scripts



FREE
myPMS

Password
Management
System

by

LVOware.com




Top 5 Submitters

lvo1160
audet37
kah00na32
Mariom24
lebjf00014

Top 5 Searches

Category Solaris51939
Category AIX49005
Category General UNIX47498
solaris23554
aix22739

Terms of Use
Privacy
Contact


 
coolcommands.com © 2013. All Right Reserved.
Programming by PRATTICO Consulting . Hosting by Apricusum