Can I modify the grep command to show only a process name?
Currently I run ps -efa | grep chk_web
to get the following:
mousr 3395 1 0 09:36:06 pts/10 0:00 sh /var/opt/scripts/chk_web.sh
Can this be changed in any way to get only:
/var/opt/scripts/chk_web.sh or chk_web.sh.
I know that if I run:
ps -efa | grep chk_web.sh |grep -v 'grep '|sed 's/^[^0-9]*\([0-9]*\)[^0-9].*$/\1/'
I will get the process ID.