Find process running on port: Difference between revisions

Jump to navigation Jump to search
Line 1: Line 1:
== Commands ==
== Find process running on port in Windows ==
* {{Win}} {{kbd | key=<nowiki>netstat –na | find "<PORT>"</nowiki>}} e.g. {{kbd | key=<nowiki>netstat –na | find "4444"</nowiki>}} or {{kbd | key = <nowiki>netstat -a | find "3306"</nowiki>}} (note: require the '''double quote''' symbol, not single quote symbol) for {{Win}}<ref>[http://technet.microsoft.com/en-us/library/bb490947.aspx Netstat]</ref>  
* GUI software: [https://www.nirsoft.net/utils/cports.html CurrPorts: Monitoring TCP/IP network connections on Windows]
* GUI software: [https://docs.microsoft.com/zh-tw/sysinternals/downloads/tcpview Windows 的 TCPView - Windows Sysinternals | Microsoft Docs]
* Command: {{kbd | key=<nowiki>netstat –na | find "<PORT>"</nowiki>}} e.g. {{kbd | key=<nowiki>netstat –na | find "4444"</nowiki>}} or {{kbd | key = <nowiki>netstat -a | find "3306"</nowiki>}} (note: require the '''double quote''' symbol, not single quote symbol) for {{Win}}<ref>[http://technet.microsoft.com/en-us/library/bb490947.aspx Netstat]</ref>  
* Command to kill: [https://www.npmjs.com/package/kill-port kill-port - npm]
 
== Find process running on port in Mac ==
* {{Mac}}  
* {{Mac}}  
** {{kbd | key=<nowiki>netstat -vanp tcp | grep 4444</nowiki>}} or  
** {{kbd | key=<nowiki>netstat -vanp tcp | grep 4444</nowiki>}} or  
** {{kbd | key=<nowiki>lsof -i tcp:4444</nowiki>}} or {{kbd | key=<nowiki>lsof -i :4444</nowiki>}}<ref>[https://man7.org/linux/man-pages/man8/lsof.8.html lsof(8) - Linux manual page]</ref>
** {{kbd | key=<nowiki>lsof -i tcp:4444</nowiki>}} or {{kbd | key=<nowiki>lsof -i :4444</nowiki>}}<ref>[https://man7.org/linux/man-pages/man8/lsof.8.html lsof(8) - Linux manual page]</ref>
** {{kbd | key=<nowiki>sudo lsof -i -P | grep LISTEN | grep :$PORT</nowiki>}}<ref>[https://stackoverflow.com/questions/4421633/who-is-listening-on-a-given-tcp-port-on-mac-os-x macos - Who is listening on a given TCP port on Mac OS X? - Stack Overflow]</ref>
** {{kbd | key=<nowiki>sudo lsof -i -P | grep LISTEN | grep :$PORT</nowiki>}}<ref>[https://stackoverflow.com/questions/4421633/who-is-listening-on-a-given-tcp-port-on-mac-os-x macos - Who is listening on a given TCP port on Mac OS X? - Stack Overflow]</ref>
== Find process running on port in Windows ==
* {{Linux}} CentOS7:  
* {{Linux}} CentOS7:  
** {{kbd | key=<nowiki>netstat -na | grep ":<port>"</nowiki>}} e.g. {{kbd | key=<nowiki>sudo netstat -pan | grep ":80"</nowiki>}} or  
** {{kbd | key=<nowiki>netstat -na | grep ":<port>"</nowiki>}} e.g. {{kbd | key=<nowiki>sudo netstat -pan | grep ":80"</nowiki>}} or  
Anonymous user

Navigation menu