3 ms·
As Awk is a pattern-matching language, you can simplify it to something like this: ps aux |awk '/what/ {print "kill " $2}' This will give you a list of kill
by kbr2000 7y ago
As Awk is a pattern-matching language, you can simplify it to something like this:
ps aux |awk '/what/ {print "kill " $2}'
This will give you a list of kill commands you can review, before piping to |sh to shake off those processes :)
And when what you try to do sequentially might take too long, you can consider throwing GNU Parallel [1] in the pipemix!
[1] https://en.wikipedia.org/wiki/GNU_parallel https://en.wikipedia.org/wiki/GNU_parallel