Find process running on port: Difference between revisions

Jump to navigation Jump to search
m
 
Line 5: Line 5:
* Command to kill: [https://www.npmjs.com/package/kill-port kill-port - npm]
* Command to kill: [https://www.npmjs.com/package/kill-port kill-port - npm]


== Find process running on port in Mac ==
== Find process running on port in Mac/Linux ==
* {{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>
* {{Linux}}
** [http://linux.die.net/man/1/nmap nmap] "Network exploration tool and security / port scanner." e.g. {{kbd | key = <nowiki>nmap -p 80,443 ip</nowiki>}}
** [http://linux.die.net/man/8/ss ss] "utility to investigate sockets" e.g. {{kbd | key = <nowiki>ss -tnlp | grep 80</nowiki>}} or using OR operator<ref>[http://www.thegeekstuff.com/2011/10/grep-or-and-not-operators/ 7 Linux Grep OR, Grep AND, Grep NOT Operator Examples]</ref> {{kbd | key = <nowiki>ss -tnlp | grep '80\|443'</nowiki>}}
** [http://linuxcommand.org/man_pages/ps1.html ps] List the current processes. Input {{kbd | key = <nowiki>ps -aux | grep "PORT_NUMBER"</nowiki>}} e.g. {{kbd | key = <nowiki>ps -aux | grep 443</nowiki>}}
** [https://docs.oracle.com/cd/E19504-01/802-5753/6i9g71m3i/index.html netstat Command] {{kbd | key=<nowiki>netstat -tulpn | grep LISTEN</nowiki>}} e.g.
** [https://docs.docker.com/engine/reference/commandline/port/ docker port | Docker Documentation]


== Find process running on port in Windows ==
== Find process running on port in Windows ==
Anonymous user

Navigation menu