Last active
August 29, 2015 14:18
-
-
Save aminamid/6061c596761b6c6b6c5f to your computer and use it in GitHub Desktop.
which process use each cpu onliner
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| while true ; do echo -e "\033[H\033[J"; ps -A -L -o pid,tid,psr,pcpu,comm= | grep -v PSR | awk '{sum[$3" "$1" "$5]+=$4};END { for (key in sum) {print key,sum[key]}}' | sort -nk1 | column -t | grep -v " 0$" ; sleep 1 ; done | |
| while true; do NOW=$(date "+%Y-%m-%dT%H:%M:%S"); ps -A -L -o pid,tid,psr,pcpu,comm= | grep -v PSR | awk '{sum[$3" "$1" "$5]+=$4};END { for (key in sum) {print key,sum[key]}}' | sort -nk1 | column -t | grep -v " 0$" | awk '{ print "'${NOW}'", $0; fflush() }' ; sleep 2 ; echo ; done | |
| pidstat -I -u -t -d -p ALL 3 65535 | grep -v -e " 0.00 0.00 0.00 " -e " 0.00 0.00 0.00 0.00 " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment