読者です 読者をやめる 読者になる 読者になる

MacOS PortをListenしているプロセスを調べるコマンド

MacOS

lsof -i:8080

http://stackoverflow.com/questions/4421633/who-is-listening-on-a-given-tcp-port-on-mac-os-x

ps aux | grep

実践

lsof -i:8080
COMMAND     PID    USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
com.apple   472 kubottiuser   12u  IPv6 0x1cfb42a923304357      0t0  TCP localhost:50216->localhost:http-alt (ESTABLISHED)
com.apple   472 kubottiuser   14u  IPv6 0x1cfb42a93d8da057      0t0  TCP localhost:50213->localhost:http-alt (ESTABLISHED)
com.apple   472 kubottiuser   19u  IPv6 0x1cfb42a93d8da057      0t0  TCP localhost:50213->localhost:http-alt (ESTABLISHED)
com.apple   472 kubottiuser   20u  IPv6 0x1cfb42a923304357      0t0  TCP localhost:50216->localhost:http-alt (ESTABLISHED)
node      25310 kubottiuser   25u  IPv6 0x1cfb42a93d8d8257      0t0  TCP localhost:http-alt->localhost:50215 (ESTABLISHED)
node      25310 kubottiuser   27u  IPv6 0x1cfb42a93d8d6457      0t0  TCP localhost:http-alt->localhost:50213 (ESTABLISHED)
node      25310 kubottiuser   30u  IPv6 0x1cfb42a93d8d5557      0t0  TCP localhost:http-alt->localhost:50216 (ESTABLISHED)
node      25310 kubottiuser   32u  IPv6 0x1cfb42a93d8d9b57      0t0  TCP *:http-alt (LISTEN)
com.apple 25339 kubottiuser   17u  IPv6 0x1cfb42a93d8d5057      0t0  TCP localhost:50215->localhost:http-alt (ESTABLISHED)
com.apple 25339 kubottiuser   18u  IPv6 0x1cfb42a93d8d5057      0t0  TCP localhost:50215->localhost:http-alt (ESTABLISHED)
ps aux | grep 25310
kubottiuser         25310   0.1  1.1  3166708 185732 s001  S+   10:56AM   0:05.86 gulp 
kubottiuser         25349   0.0  0.0  2463152    460 s000  U+   10:57AM   0:00.00 grep 25310

8080を使っているのはgulpの開発用ウェブサーバー