-
-
Save ruevaughn/63b2243fbc0f23d70b450ec63f3f34fa to your computer and use it in GitHub Desktop.
Helps you to kill unnecessary tasks running on linux and ubuntu.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Task Killer | |
# Helps you to kill unnecessary tasks running on linux and ubuntu. | |
echo -e "$1 - Killing task..." | |
totaltask=$(ps aux | grep "$1" | sed '/grep/d' | wc -l) | |
echo -e "Total $totaltask tasks found" | |
sleep 3s | |
ps aux | grep "$1" | sed '/grep/d' | awk '{print $2}' | while read -r line; do kill $line; done &> /dev/null | |
exit 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment