Re: [SLUG] Is there a shell one liner to do this?

From: Tim Jones (tim@linuxtampa.com)
Date: Tue Apr 10 2001 - 09:44:18 EDT


On Tue, Apr 10, 2001 at 05:21:59AM -0700, Michael Manchester wrote:
> I was wondering if there is a shell oneliner that can
> take the ouput of ps -A and piping through grep or awk
> kill process that match a search string.
>
> Sometimes netscape leaves a number netscape-common
> process running. When this happens I have to kill all
> of these before netscape will start again. I'm looking
> for a quick easy way to kill all of these process from
> the shell prompt.

I confess to having a similar problem: netscape locking up, chewing
up all spare CPU cycles and refusing to redraw itself. So, I made
the following tiny scripts, both called 'n'. Golde runs SuSE 7.0 and
bobo runs Debian 2.2. Just substitute whatever your process names are.

  tim@golde:/usr/X11R6/bin > cat /usr/local/bin/n
  #!/bin/bash
  killall -9 netscape
  cd /usr/local/netscape
  ./netscape &

  tim@golde:/usr/X11R6/bin > ssh bobo cat /usr/local/bin/n
  #!/bin/bash
  killall -9 netscape netscape-communicator communicator-smotif.real
  netscape &

Tim

-- 
-----------------------------------------------
 Timothy Jones - LinuxTampa.com - 813-65-LINUX
Open Source Programming, Databases & Networking
-----------------------------------------------



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 20:26:00 EDT