Skip to content

Instantly share code, notes, and snippets.

@SamRothCA
Created October 30, 2014 20:46
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SamRothCA/c6abc2a617f8eb11d374 to your computer and use it in GitHub Desktop.
Save SamRothCA/c6abc2a617f8eb11d374 to your computer and use it in GitHub Desktop.
Display the top five processes by CPU usage
ps xro %cpu=,comm= | while read cpu comm; ((i++<5)); do echo $cpu% $(basename "$comm"); done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment