Files
Bjorn/kill_port_8000.sh
2024-11-07 16:39:14 +01:00

12 lines
250 B
Bash

#!/bin/bash
# Script to kill processes using port 8000
PORT=8000
PIDS=$(lsof -t -i:$PORT)
if [ -n "$PIDS" ]; then
echo "Killing the following PIDs using port $PORT: $PIDS"
kill -9 $PIDS
else
echo "No processes found using port $PORT"
fi