Re: kill process using job

On 12 Apr., 15:33, SiKing <nos...@xxxxxxxxxxxxx> wrote:
urram...@xxxxxxxxx wrote:
want kill process

The (really) long way:
ps -ef | grep listener | grep -v grep | awk '{print $2}' | xargs kill

If you use awk in the pipeline there's no need for two additional grep
processes; awk can do that.


The (not so) long way:
ps -ef | grep '[l]istener' | awk '{print $2}' | xargs kill

The short way (if installed):
pkill -f listener


Version: 3.1
GE d+(-) s+: a@ C+ ULAHS++$ P- L+>++ E--- W++ N++ o !K w--(+) O- M?>+ V? PS+
PE+(++) Y+ PGP- t+ 5 X R !tv b+ DI(+) D G e++ h---- r+++@ y++++


Relevant Pages

  • Re: kill process using job
    ... want kill process ... processes; awk can do that. ... I always mess up the quotes inside of quotes though. ...
  • Re: General UNIX puzzle
    ... All of those (sed, awk, grep) involve making a copy of the original file ... The gnu shtool is one of the most useful tools for this for in-place ... A Galileo could no more be elected president of the United States than ...
  • Re: ssh and chroot
    ... ++ echo /bin/mkdir ... ++ awk '' ... ++ grep '^/' ...
  • Re: The smartest band in the world?
    ... I mainly use grep, but I'm ... going to learn awk and sed and improve my bash scripting. ... Oracle accreditation coure, well in the grad courses at least, everything ...
  • Re: Difference between Cygwin and DOS handling of string input
    ... Ton of userland tools that make work possible (perl, sed, awk, grep, ... cmd.exe is a shell in that it's a TTY that lets you run commands, ...