Skip to content

Instantly share code, notes, and snippets.

@zhiguangwang
Last active April 20, 2016 01:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zhiguangwang/b4537f45864161890ec650b0b5c479f5 to your computer and use it in GitHub Desktop.
Save zhiguangwang/b4537f45864161890ec650b0b5c479f5 to your computer and use it in GitHub Desktop.
Get CPU usage of a process by name
top -b -n 1 -p `pgrep $PROCESS_NAME` | grep $PROCESS_NAME | awk {'print $9'}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment