Linux Port Status View, port open and close __linux

Source: Internet
Author: User
See how much the FTP default port is

Sometimes we need to look at the default port for a service, it's good to do under Linux, no need to search the Internet, the direct view of the "/etc/server" file can meet the demand. There is a mapping between the port number and the service.

For example, we'd like to see the port that the IPP protocol uses by default is available through this command:


Cat/etc/service|grep IPP
View all ports that are open

Under Linux There are two commands, one is netstat, the other is SS.
Using Netstat is:
Netstat-tanp

where T represents a nested-section link for the TCP protocol, there are U (UDP), W (RAW), and X (UNIX) sockets in addition to T.

A represents all, and this so-called all refers to the port that includes the listening. At some point, some of the ports being opened are being transmitted, while others are just listening.

N: Display the port number directly instead of the service name corresponding to the "/etc/server" display port

P: Displays the process that occupies the port number.

L: Displays the port that is being monitored.
Close an end port

by NETSTAT-TANP to see which process a port is occupied by, and then through the "Killall process name" To kill the process is OK

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.