Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there any way of killing all instances of a specific program with a command-line command?

share|improve this question

closed as not a real question by Karan, terdon, TFM, Tog, Journeyman Geek Mar 13 '13 at 10:12

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

Which OS? It's killall under *ix. – Dave C Mar 12 '13 at 19:42
This question is too broad, unless you specify an OS or two you want to accomplish this on. – Karan Mar 13 '13 at 2:59

In GNU/Linux, BSD, OS X, and other Unix-likes

killall program

In Windows

taskkill /IM program.exe
share|improve this answer
Careful with "other Unix-likes": On Solaris, killall, well, kills all: – us2012 Mar 13 '13 at 8:58

On many system you will find the commands kill and killall.

If you know the PID of the process then you can use kill PID

The first kills only one specific process. (Or rather, it sends a signal to it, e.g. the signal to terminate). You can write a wrapper around that with ps and grep to kill all processes matching a name.

or, if installed, you could use killall

Beware though, not all killall commands do the same thing. On Solaris it kills all processes. I repeat, all. Not just those you wanted but each and every process you have the rights to kill will get killed. Make sure you check the manual page of your local system and or check if it is a link to killall5.

share|improve this answer
Nice. So is killall5 the nasty one or the one that kills the processes you wanted to? – LarsH Mar 13 '13 at 2:05
killall5 is the nasty one. – cpast Mar 13 '13 at 3:59

On Windows 7 (Vista?), I prefer tskill processname as you don't need to remember command line switches or write .exe at the end. eg:

tskill chrome

Will kill all chrome processes.

On windows XP I used pskill from the pstools suite, which uses a similar syntax. Both these commands can also work on remote computers, if you have admin rights.

share|improve this answer

In windows if you want to kill a process and any child processes which were started by it you should use this command Taskkill /im program.exe /t

share|improve this answer

On Windows 7 there is taskkill.

share|improve this answer

for Windows, you can use
taskkill /im program_name
use taskkill /im program_name /f for more problematic programs
Use ProcessExplorer if you want a GUI alternative for Taskmanager

share|improve this answer

On Linux, the command is either pkill or killall. pkill is generally recommended, since on some systems, killall will actually kill all processes.

share|improve this answer
dis ~ # killall Usage: killall [OPTION]... [--] NAME... killall -l, --list killall -V, --version -e,--exact require exact match for very long names -I,--ignore-case case insensitive process name match ... – elcash Mar 13 '13 at 5:55
@Brendan Long: It is not an urban legend. On some SYS V systems killall actually kills all. That is not necessary a bad thing, but if you are not expecting it to behave differently on a different system then you might get an educational moment. – Hennes Mar 13 '13 at 11:46

Hmm, and to think that I've been using pkill all these years...

share|improve this answer

Not the answer you're looking for? Browse other questions tagged .