[wplug] Favorite handy one line commands

Eric C. Cooper ecc at cmu.edu
Thu Jun 5 10:06:48 EDT 2003


On Wed, Jun 04, 2003 at 11:58:31PM -0400, James O'Kane wrote:
> 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.

Or: renice -20 `pidof nfsd`

-- 
Eric C. Cooper          e c c @ c m u . e d u



More information about the wplug mailing list