Whenever I kill a process I normally am killing a frozen Chrome tab using: kill chrome and then I scroll down to see the process, that is like at 99%. Adding this sort allows me to easily kill the process hog.
I changed:
origional processes = ps -A -o pid -o %cpu -o comm | grep -i [^/]*#{Regexp.quote(theQuery)}[^/]*$.split("\n")
updated processes = ps -A -o pid -o %cpu -o comm | grep -i [^/]*#{Regexp.quote(theQuery)}[^/]*$ | sort -nr -k2.split("\n")
by adding | sort -nr -k2 it will sort column 2 reverse numerical.

Whenever I kill a process I normally am killing a frozen Chrome tab using: kill chrome and then I scroll down to see the process, that is like at 99%. Adding this sort allows me to easily kill the process hog.
I changed:
origional processes =
ps -A -o pid -o %cpu -o comm | grep -i [^/]*#{Regexp.quote(theQuery)}[^/]*$.split("\n")updated processes =
ps -A -o pid -o %cpu -o comm | grep -i [^/]*#{Regexp.quote(theQuery)}[^/]*$ | sort -nr -k2.split("\n")by adding | sort -nr -k2 it will sort column 2 reverse numerical.