[wplug] Favorite handy one line commands

James O'Kane jo2y at midnightlinux.com
Wed Jun 4 23:58:31 EDT 2003


On Wed, 4 Jun 2003, Tim Lesher wrote:

> On Wed, Jun 04, 2003 at 10:04:08PM -0400, John wrote:
> > kill -9 `ps aux | grep processname | awk '{print $2}'`
> 
> Isn't 'killall -9 processname' easier?

Think bigger picture. :)

I used to use a similar syntax to renice nfsd.

ps aux |grep [n]fsd | awk '{print $2}' | xargs renice -20

The [n]fsd will match nfsd but not itself. This is one way to keeping the 
grep command out of the list of pids.


-james





More information about the wplug mailing list