Tuesday, June 10, 2008

Process Status of Any Process Containing given String

In order to get Process Status (ps) of any process containing given string
(say 'mitesh'), we use to type following commands, which are long and
tedious to type.

$ ps auxww | grep "mitesh" | grep -v grep

Instead, if we type

$ psg.sh mitesh

which is more convenient to type. So what this '
psg.sh'
contains (I am assuming, that
~/bin is in $PATH):

$ vi ~/bin/psg.sh

#!/bin/bash
function is ()
{
ps auxww | grep "$@" | grep -v "grep"
}

is $@

# END : psg.sh

No comments: