[Bash] Find & Kill a running port

If the server starts on a different port, such as 3001 or 3002, this is because another process is currently running on port 3000. This is ok, but you may get confused during the exercises. It's a better idea to find the running process and kill it.

Mac/Linux

lsof -i tcp:3000
## Find the ID of the process
kill <process id>

Windows

netstat -ano | findstr :3000
Find the ID of the process
taskkill /PID typeyourPIDhere /F
posted @ 2022-09-14 14:09  Zhentiw  阅读(13)  评论(0编辑  收藏  举报