Skip to content

Instantly share code, notes, and snippets.

@justinkambic
Created April 25, 2023 14:18
Show Gist options
  • Save justinkambic/350a705a1a4948ba96f6d10a84072e37 to your computer and use it in GitHub Desktop.
Save justinkambic/350a705a1a4948ba96f6d10a84072e37 to your computer and use it in GitHub Desktop.
Killall script recorder
#!/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