如何查找/使用我的tcp端口的进程? 我在mac os x。
有时,在崩溃或一些错误之后,我的rails应用程序是锁定端口3000.我找不到它使用ps -ef ...如何找到愚蠢的事情,杀死它,残酷地...?
在做什么
rails server我得到
地址已经在使用 - bind(2)(Errno :: EADDRINUSE)
2014年更新:
要完成以下一些答案:执行kill命令后,可能需要删除pid文件rm ~/mypath/myrailsapp/tmp/pids/server.pid
How do I find (and kill) processes that listen to/use my tcp ports? I'm on mac os x.
Sometimes, after a crash or some bug, my rails app is locking port 3000. I can't find it using ps -ef...
When doing
rails serverI get
Address already in use - bind(2) (Errno::EADDRINUSE)
2014 update:
To complete some of the answers below: After executing the kill commands, deleting the pid file might be necessary rm ~/mypath/myrailsapp/tmp/pids/server.pid
最满意答案
你可以试试netstat
netstat -vanp tcp | grep 3000对于OSX El Capitan和更新版本(或者如果您的netstat不支持-p ),请使用lsof
lsof -i tcp:3000You can try netstat
netstat -vanp tcp | grep 3000For macOS El Capitan and newer (or if your netstat doesn't support -p), use lsof
sudo lsof -i tcp:3000For Centos 7 use
netstat -vanp --tcp | grep 3000更多推荐
发布评论