From: Oleg Broytman Date: Sat, 22 Nov 2014 03:27:24 +0000 (+0300) Subject: killall can also be used to kill processes by name X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=89cab0c26e1f8cd8ec782d112a9f495af32d11c2;p=dotfiles.git killall can also be used to kill processes by name --- diff --git a/.shellrc b/.shellrc index 2ef0bdb..b6c9892 100644 --- a/.shellrc +++ b/.shellrc @@ -81,7 +81,7 @@ pswg() { ps auxwww | grep -i ${1:+"$@"} | grep -v '\(ps auxw\|grep\)'; } # Like pgrep -f pidOf() { ps auxwww | grep -i ${1:+"$@"} | grep -v '\(ps auxw\|grep\|pidOf\|KillAll\)' | awk '{print $2}'; } -# A kind of pkill +# A kind of pkill/killall KillAll() { if [ -z "$2" ]; then kill `pidOf "$1"`