Skip to content

Instantly share code, notes, and snippets.

@VictorTaelin
Created May 6, 2024 23:27
Show Gist options
  • Save VictorTaelin/a83d791cd43d60a665e2f3f2f262c3b7 to your computer and use it in GitHub Desktop.
Save VictorTaelin/a83d791cd43d60a665e2f3f2f262c3b7 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Find all hvm processes and extract their PIDs
pids=$(ps aux | grep hvm | grep -v grep | awk '{print $2}')
# Check if any hvm processes were found
if [ -z "$pids" ]; then
echo "No hvm processes found."
else
# Forcefully kill each hvm process
for pid in $pids; do
echo "Killing hvm process with PID $pid"
kill -9 $pid
done
echo "All hvm processes have been killed."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment