Freeing up a TCP/IP port?

前端 未结 11 1117
时光取名叫无心
时光取名叫无心 2020-12-07 06:59

netstat -tulnap shows me what ports are in use. How to free up a port in Linux?

11条回答
  •  南笙
    南笙 (楼主)
    2020-12-07 07:19

    As the others have said, you'll have to kill all processes that are listening on that port. The easiest way to do that would be to use the fuser(1) command. For example, to see all of the processes listening for http requests on port 80 (run as root or use sudo):

    # fuser 80/tcp
    

    If you want to kill them, then just add the -k option.

提交回复
热议问题