Created
November 29, 2023 09:07
-
-
Save stroehleina/216dba2a6a58d461b6a756b2753b2869 to your computer and use it in GitHub Desktop.
Find processes by name and SIGTERM kill them all (when an application is hung up and cannot be closed)
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
# Usage: kill_app_by_pid.sh <name_of_application> | |
# https://docs.oracle.com/cd/E19253-01/817-0403/eoizf/index.html | |
# WARNING: The –9 signal should not be used to kill certain processes, such as a database process, or an LDAP server process. | |
# The result is that data might be lost. | |
ps -u $USER -eaf | grep -i $1 | awk '{print $2}' | while read line; do kill -9 $line; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment