Last active
November 28, 2021 15:49
-
-
Save spion/5213058 to your computer and use it in GitHub Desktop.
killgrep and psgrep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Put me in /usr/local/bin/killgrep | |
ps aux | egrep $1 | egrep -v '(killgrep)|(egrep)' | awk '{print $2}' | xargs kill -9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Put me in /usr/local/bin/psgrep | |
ps aux | egrep $1 | egrep -v '(psgrep)|(egrep)' |
Не е исто бидејќи killall работи само со името на binary-то, не и со аргументите (значи не работи за python/node скрипти).
Check this:
$ pgrep name
$ pkill name
$ pkill --signal 15 name
Doesn't work with scripts, they're arguments to the command so pgrep
doesn't get them.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
не е ова исто со killall?