简单常识

  • 查看端口占用情况:
      打开命令行,输入以下命令;
lsof -i tcp:portXxx(端口号,比如8700)

  如果端口被占用了,结果如下(以我的电脑查看8700端口来举例):

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
studio 854 kl 622u IPV4 0x33e412fdsdsfb 0t0 TCP localhost:8700(LISTEN)
  • 杀掉占用当前端口号的进程:
sudo kill -9 pidXxx(进程号)

//以上面的8700端口的进程号为例;
sudo kill -9 854

-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-------------------------last line for now-----------------------