A shortcut to eliminate processes on windows.
In a typical web development workflow on windows, we are working with git bash rather than cmd or PowerShell.
Windows has a nifty but verbose way of killing processes based on a (partial) match of the process name: wmic process where "name like '%some string%'" delete
.
This function is just a convenience wrapper around it.
There are two ways of using the function: With argument or without.
When called with an argument, any process that has a name matching the argument will be killed.
This example kills any java
process, but also any other process with jav
in the name (like an imaginary javelin
process):
$ kill jav
If you just type kill
and hit enter, you will be prompted for a process name/matcher to kill.
You then type it in a second step and hit enter again:
$ kill
>> Enter a process name and press [ENTER] (partial matching)
jav