Last active
July 1, 2017 07:30
-
-
Save JJ/00d60f2347252fd950654375951612c6 to your computer and use it in GitHub Desktop.
Get the process PID consuming the most CPU
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
# get the list of PIDs and cpu use, sort numerically using the second column or key, take the last one, and extract the second column | |
ps —no-headers -eo pid,%cpu | sort -k2 -n | tail -1 | cut -d ' ' -f 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment