pKill Function for Git-Bash

I constantly find myself accidentally typing pkill in git-bash and then it not being supported because, you know, it’s not a windows command.

So I quickly wrote a function for it and put it in the .bashrc file under my users home directory.

Below is the code snippet – .bashrc:

function pkill(){
	wmic Path win32_process Where "CommandLine Like '%$2%'" Call Terminate
}

Invoked like this:

One thought on “pKill Function for Git-Bash

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s