xxxxxxxxxx
# Find the process running on a specific port
lsof -i :<port_number>
# Replace <port_number> with the actual port number you want to kill
# Extract the process ID (PID) from the output
PID=$(lsof -i :<port_number> | awk '(NR!=1) {print $2}')
# Kill the process
kill -9 $PID
xxxxxxxxxx
kill -9 $(sudo lsof -ti:3000) # force kill one port
kill -9 $(sudo lsof -ti:3000,3001) # force kill multiple port