Skip to content

Instantly share code, notes, and snippets.

@btotr
Created July 7, 2011 07:36
Show Gist options
  • Save btotr/1069051 to your computer and use it in GitHub Desktop.
Save btotr/1069051 to your computer and use it in GitHub Desktop.
CPU snapshot
for i in {1..10}; do ps -e -o pcpu -o pid | grep 91422 | grep -v grep | awk '{print $1}'; sleep 1; done | awk '{sum+=$1} END {print sum/10}'
@btotr
Copy link
Author

btotr commented Jul 7, 2011

Change the pid 91422 to your own

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment