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:

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 )

Google photo

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

Twitter picture

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

Facebook photo

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

Connecting to %s