How to kill (a great many) processes
Sometimes Resque processes hang. Here's a snippet that helped me kill stale processes:
for pid in `ps aux | grep resque | awk '{print $2}'`; do
kill -9 $pid;
done
Alternatively, you could also do:
ps aux | grep resque | awk '{print $2}' | xargs kill
Written by David Weiser
Related protips
3 Responses
With a bash function you can kill processes by name like this:
function killallp() {
kill `ps -ef | grep $1 | grep -v grep | awk '{print $2}'`;
}
$ killallp resque
over 1 year ago
·
@runexec Thanks!
over 1 year ago
·
@endel Thanks!
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Related Tags
#bash
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#