4 ms·
grrr.... pkill thing killall thing And then there's also pgrep instead of ps | grep
by partycoder 10y ago
grrr....
pkill thing
killall thing
And then there's also pgrep instead of ps | grep
- amyjess 10y agokillall and pkill don't work if the thing I'm trying to grep for isn't the first word of the process string. Let's say I'm trying to kill 'python foobar.py' but I don't want to kill 'python bazquux.py'. The only thing it'll respond to with killall is 'killall python', but then both of them will respond. So I have to grep out the parameter and then kill that, with: ps -ef | grep 'foobar.py' | awk '{print "kill -9 " $2}' | sh
- deleted 10y ago[deleted]
- skovorodkin 10y agoCheck out -f parameter of pkill.
- amyjess 10y agoOoh... nice! Thanks!