[lug] Regex from shell

David Morris lists at morris-clan.net
Sat Nov 20 16:20:19 MST 2004


On Fri, Nov 19, 2004 at 01:41:47PM -0800, Budyanto Himawan wrote:
> Hey...thanks a lot.
> 
> This was what I was looking for
> kill 111{0,1,2,3,4,5,6,7,8,9}.
> 
> But this
> kill $( seq 1110 1119 ) is a whole lot more elegant.:)

If you want to kill a large number of processes that aren't
in a nice pattern and killall/pkill don't quite get what you
want (which I seem to need constantly), try ps/grep/awk:

    kill `ps -afe | grep '<pattern>' | awk '{print $2}'`

--David




More information about the LUG mailing list