Linux address port number is occupied

Source: Internet
Author: User

We often need to solve the problem of port occupancy under Linux, the workaround is as follows:

Linux:

1 A port number is occupied, view PID
# #根据端口查看进程信息
lsof-i:14700
# #根据进程号查看进程对应的可执行程序
PS-F-P Process number

Also available netstat
Common parameters for Netstat:-T,-u,-w, and-X represent TCP, UDP, raw, and UNIX socket connections, respectively. The-a flag, which also shows a socket waiting to be connected (that is, in listening mode). -L Displays the port being monitored (listen),-n indicates that the port number is displayed directly instead of the/etc/service to the port name, and the-p option indicates that the listener is listed with the-p parameter to display the PID

This example uses Netstat-atn to

Then you can kill the PID.


Above.

Linux address port number is occupied

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.