Skip to content

Adding support for sorting by process %cpu #10

@codeversed

Description

@codeversed

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions