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

  • 12
    Which OS? It's killall under *ix. – Dave C Mar 12 '13 at 19:42
  • 1
    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

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.


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.

  • 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

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


On Windows 7 there is taskkill.


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


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

  • 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
  • 1
    @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

Not the answer you're looking for? Browse other questions tagged or ask your own question.