Created
July 12, 2021 08:19
-
-
Save R0X4R/d211d1c1bd804cc46edff79f8c9102c3 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