sudo lsof -i :3000
kill -9 <PID>
npx kill-port 8080
kill -9 $(sudo lsof -ti:3000) # force kill one port
kill -9 $(sudo lsof -ti:3000,3001) # force kill multiple port
sudo lsof -i :5955
npx kill-port 3000
npx kill-port port_number
e.g,
npx kill-port 5001
kill -9 $(lsof -ti:3000,3001)
//Find Pid
sudo lsof -i :3000
//kill
kill -9 <pid>
sudo lsof -i :5955
ex returns:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
node 6957 someuser 28u IPv6 0x85e555655e4ea0c3 0t0 TCP *:8091 (LISTEN)
sudo kill -9 6957
sudo lsof -i <Port>
sudo kill -9 <PID>
kill $(lsof -ti:3000,3001,8080)
brew tap devasghar/portkill && brew install devasghar/portkill/homebrew-portkill
# Usage
portkill 3000
portkill 3000,3001
lsof -i tcp:3000
sudo lsof -i :8080
kill -9 <PID>
sudo lsof -i :<port>
kill -9 <PID>
lsof -n -i4TCP:3000
OR lsof -i:3000
THEN kill -9 "PID"