EMBED YOUR TERMINAL RECORDINGS ONLINE


Kill processes by pattern

DATE: 2011-10-13
AUTHOR: Jo Giraerts
AUTHOR WWW: http://blog.copywaste.org
RELATED ARTICLE: http://www.go4expert.com/forums/showthread.php?t=17747
EMBED THIS RECORDING:
<div><script id="playterm-MjAxMS0xMC9raWxsZXItMTMxODQ1OTQ2M3wxMjB4MzU=" type="text/javascript" src="https://playterm.org/js/?hash=MjAxMS0xMC9raWxsZXItMTMxODQ1OTQ2M3wxMjB4MzU=" class="size:120x35"></script></div>


Related recordings:

VISUAL SELECTS IN VIM
tags: vim visual selects regex text editing fast
FIND WITH GREP
tags: find grep
GREP WITH FIND'S EXEC OPTION
tags: regex grep find exec
CLEAN UP SVN SANDBOX
tags: svn awk grep xargs
KILLING MULTIPLE PROCESSES
tags: kill pkill grep ps awk
SED, STRING TOOLBOX FOR LAZY PEOPLE
tags: sed string manipulation regular expression regex
BASIC AWK USAGE
tags: awk ps regexp





Kill all processes that match a certain pattern

Coder of Salvation said

Nicely done! The 'killall' command might also be worth mentioning:
$ killall vim
But I think it'll be less specific as your method (but handy if you know for sure the process is
exactly called 'vim')
Also, maybe persons less familiar with awk could use 'cut -f 2' to get the processid.
again, great stuff

HarleyPig said

You can use pgrep/pkill for this, if it's installed on your system:
pgrep prog.*1
pid
pid
pid
pkill prog.*1
will kill all the pids matching the pattern.

 

Name   
Email (never shown)  
Comment