zoukankan      html  css  js  c++  java
  • 查询哪个程序在使用某个端口

    When you try to launch your web server, you might have this error. It means that another program already uses the port you have chosen. To solve it check that you have not forgotten to stop another server running on your machine.

    MacOs / Linux

    You can check which program is listening on port 8084 with this command :

    $ sudo lsof -i 8084

    lsof means “list open files”.

    The column COMMAND allow you to identify the command name

    PID is the process id (10206)

    USER : is the user that launched the program (here me)

    TYPE : inform you about the type of the open file. (here IPv4)

    From the command line, you can directly kill the process with the following command :

    $ kill 10206

    Windows

    The following command will give you the process id of the program listening on port 8084:

    $ netstat -ano | find "8084"

    TCP 0.0.0.0:8084 0.0.0.0:0 LISTENING 10206

    10206 is the process id of the program listening on 0.0.0.0:8084.

    To kill this process, you can use the following command :

    $ taskkill /F /PID 10206

    ref:

    https://www.practical-go-lessons.com/chap-26-basic-http-server

  • 相关阅读:
    struts.xml文件中package元素的各大属性讲解
    strus2 struts.xml详解
    既使用maven编译,又使用lib下的Jar包
    Maven项目同时使用lib下的Jar包
    PreparedStatement ResultSet
    SearchBySql
    java 生成GUID
    获取当前时间的字符串
    C#字符串比较
    浮点数比较大小
  • 原文地址:https://www.cnblogs.com/zgq25302111/p/15141351.html
Copyright © 2011-2022 走看看