The netstat command analyzes the netstat command to check the network conditions of the local machine. mannetstat can see the basic descriptions of netstat-Printnetworkconnections, routingtables, interfacestatistics, and masqueradeconnec... the netstat command analyzes the netstat command to check the network conditions of the local machine. man netstat can see the basic descriptions of netstat-Print network connections, routing tables, interface statistics, and masquerade connections, and multicast memberships let's take a simple example. to display the tcp protocol, use the-t parameter, including tcp and tcp6 [plain] netstat-t Active Internet co Nnections (w/o servers) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 localhost: 59226 localhost: 8527 ESTABLISHED tcp 0 0 bogon: 44385 117.79.93.222: http TIME_WAIT tcp 0 localhost: 8527 localhost: 59305 CLOSE_WAIT tcp 0 0 localhost: 8527 localhost: 59235 ESTABLISHED tcp 0 1 bogon: 36113 tf-in-f19.1e100.n: https SYN_SENT tcp 0 0 bogon: 49941 117.79.93.196: http TIME_WAIT tcp 0 0 bogon: 535 74 117.79.93.208: http ESTABLISHED tcp 0 0 localhost: 59259 localhost: 8527 the number of ESTABLISHED entries is too large, and only a part is displayed. Add a-l parameter to display only the TCP program listening to the local port. now the program is much less. [Plain] netstat-tl Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 localhost: 8527 *: * LISTEN tcp 0 0 *: http *: * LISTEN tcp 0 localhost: domain *: * LISTEN tcp 0 localhost: ipp *: * LISTEN tcp 0 0 *: https *: * LISTEN tcp6 0 ip6-localhost: 8527 [:]: * LISTEN tcp6 0 0 ip6-localhost: ipp [:]: * LISTEN pay attention to the Local Address column above, display not IP Address, but localhost, to display the IP Address, add a parameter-n [plain] netstat-tln Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 127.0.0.1: 8527 0.0.0.0: * LISTEN tcp 0 0 0.0.0.0: 80 0.0.0.0: * LISTEN tcp 0 0 127.0.0.1: 53 0.0.0.0: * LISTEN tcp 0 0 127.0.0.1: 631 0.0.0.0: * LISTEN tcp 0 0 0.0.0.0: 443 0.0.0.0: * LISTEN tcp6 0 0: 1: 8527: * LISTEN tcp6 0 0: 1: 631: * LISTEN if you want to display the process name and ID, add another parameter-p [plain] netstat-tlnp Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 127.0.0.1: 8527 0.0.0.0: * LISTEN 6506/ssh tcp 0 0.0.0.0: 80 0.0.0.0: * LISTEN 889/nginx tcp 0 127.0.0.1: 53 0.0.0.0: * LISTEN 1268/dnsmasq tcp 0 0 127.0.0.1: 631 0.0.0.0: * LISTEN 590/cupsd tcp 0 0.0.0.0: 443 0.0.0.0: * LISTEN 889/nginx tcp6 0 0: 1: 8527 ::: * LISTEN 6506/ssh tcp6 0 0: 1: 631: * LISTEN 590/cupsd with grep, you can find the process listening to a local port [plain] netstat-tlnp | grep 127.0.0.1: 8527 tcp 0 127.0.0.1: 8527 0.0.0.0: * LISTEN 6506/ssh
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