Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support for sorting by process %cpu #10

Open
codeversed opened this issue Mar 18, 2016 · 0 comments · May be fixed by #13
Open

Adding support for sorting by process %cpu #10

codeversed opened this issue Mar 18, 2016 · 0 comments · May be fixed by #13

Comments

@codeversed
Copy link

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.

image

@yannickglt yannickglt linked a pull request Jun 16, 2017 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant