Skip to content

Instantly share code, notes, and snippets.

@GoingMyWay
Last active May 17, 2021 00:58
Show Gist options
  • Save GoingMyWay/7b9effa8dcc8c7d8d474c90cf29cda0c to your computer and use it in GitHub Desktop.
Save GoingMyWay/7b9effa8dcc8c7d8d474c90cf29cda0c to your computer and use it in GitHub Desktop.
#!/bin/bash
echo "task: ${1}, to be killed"
ps -ef | grep $1
echo "killing task: ${1}"
for id in `ps -ef | grep $1 | awk ' { print $2 } '`; do kill -9 $id; done
@GoingMyWay
Copy link
Author

GoingMyWay commented Feb 1, 2021

So, now you need only type like this

$ kill_task tensorboard

Installation

mkdir -p ${HOME}/opt
cd ${HOME}/opt 
wget https://gist.githubusercontent.com/GoingMyWay/7b9effa8dcc8c7d8d474c90cf29cda0c/raw/7bc8e03594f6ff243c4f79da0c46796b4bd98ceb/kill_task
chmod u+x kill_task
echo "export PATH=$PATH:${HOME}/opt" >> ${HOME}/.zshrc
source ${HOME}/.zshrc
cd -

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment