Skip to content

Instantly share code, notes, and snippets.

@mrmanc
Last active July 29, 2017 01:06
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 mrmanc/14bdf23b4bd0ab868e90ddb723404685 to your computer and use it in GitHub Desktop.
Save mrmanc/14bdf23b4bd0ab868e90ddb723404685 to your computer and use it in GitHub Desktop.
macos top snapshot with cpu
top -stats pid,cpu,command -l 2 -o cpu | awk 'BEGIN{sampleNumber=0} /^PID/ {sampleNumber += 1;} {if (sampleNumber == 2) {print $0}}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment