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

  • 相关阅读:
    shell脚本基础
    rtsp冷门解释
    C++基础之动态内存
    树莓派3安装ros
    Trie树
    [LeetCode]The Skyline Problem
    [LeetCode]Implement Trie (Prefix Tree)
    C++基础之适配器
    配置树莓派3的openwrt中的网络
    [LeetCode]Self Crossing
  • 原文地址:https://www.cnblogs.com/zgq25302111/p/15141351.html
Copyright © 2011-2022 走看看