|
| cool Statistics |
| | coolcommands: | 1338 | | Categories: | 83 | | Total queries: | 620082 | | Members: | 22813 | |
|
|
|
 |
|
|
Search coolcommands.com
 |
Submitted by:
lvo   |
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
|  |  |  |  |
|
|
|
|
 |
|
|
|
Top 5 Submitters
|
|---|
| lvo | 1160 |
| audet | 37 |
| kah00na | 32 |
| Mariom | 24 |
| lebjf000 | 14 |
Top 5 Searches
|
| Category Solaris | 51939 |
| Category AIX | 49005 |
| Category General UNIX | 47498 |
| solaris | 23554 |
| aix | 22739 |
|
|
|
|