# Mac查看端口占用
可以通过命令lsof
(list open files)查看端口占用情况:
$ lsof -i:9393
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
java 34708 larry 47u IPv6 0x5e2cede59b5310d9 0t0 TCP *:9393 (LISTEN)
$ ps aux| grep 34708
larry 34708 0.0 0.8 16232092 267440 s003 S+ Sat02AM 2:01.25 /usr/bin/java -jar spring-cloud-dataflow-server-2.5.3.RELEASE.jar
larry 63773 0.0 0.0 4399332 756 s000 S+ 9:04AM 0:00.00 grep 34708
要杀死进程可以用以下命令:
$ kill -9 pid