Return to Snippet

Revision: 19159
at October 16, 2009 18:47 by kitzelh


Initial Code
function fps {
        (( $# )) &&
        ps -aux | sed -n "1p;/___fps___/d;/$1/p" ||
        echo "Usage: fps <search string>"
    }

#Modified for use with multiple words in any order:

    function fps {
        typeset x y
        for x in $@; do y="$y/$x/!d;"; done
        ps -ef | sed -n "1p;/___fps___/d;${y}p"
    }

Initial URL

                                

Initial Description
I'm constantly checking to see if a certain program or process is running. This helps reduce the typing and the clutter.

Initial Title
Fast Process Search

Initial Tags
search

Initial Language
Bash