Created
April 25, 2023 14:18
-
-
Save justinkambic/350a705a1a4948ba96f6d10a84072e37 to your computer and use it in GitHub Desktop.
Killall script recorder
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 | |
# Set the substring to search for in the command name | |
substring="synthetics-recorder" | |
# Find the process IDs (PIDs) of processes whose command contains the substring | |
pids=$(pgrep -f "$substring") | |
# Loop through each PID and send SIGTERM to terminate the process | |
for pid in $pids; do | |
echo "Terminating process with PID $pid" | |
kill -15 $pid | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment