how to kill if any process in linux code example
Example 1: Check for process and kill if running Linux
if pgrep process_name 2>/dev/null; then
echo "Terminating process_name"
pkill process_name
fi
Example 2: how to kill a process in linux
kill -KILL PIDnumber ... for example, kill -KILL 12345