[Linux]linux command to learn-netstat

Source: Internet
Author: User

Linux Many services are related to the network, when the service is not available or the start port is occupied, or is blocked by the firewall, you need to query the network-related problems, netstat command will only use one or two parameters here, a good study.

A few common options:

    • -A (All) displays all options and does not show listen related by default
    • -T (TCP) displays only TCP-related options
    • -U (UDP) displays only UDP-related options
    • -N refuses to display aliases, showing all numbers converted to numbers
    • -l list only service status in Listen (listening)
    • -C executes the netstat command every other fixed time
    • -S display statistics for the network
    • -p lists the PID of the program, which is useful
    • -R Display Routing table
    • -e Display Other outreach information

Use case:

1 View all TCP ports

$ netstat -at

2 View all TCP ports on listening

$ netstat -lt

3 Finding the port of the SSH service

$ netstat -alpt|grep ssh

4 Display network card and NIC information

$ netstat -ie

5 View all routing tables in TCP connections

# netstat -ant

6 View only monitored connections, as well as PID information (common)

# NETSTAT-TNLP

7 View TCP connections per second

# netstat -ct

8 See if a service is running

netstat -alpnt|grep ssh

There are more commonly used in adding.


This article from the "Orangleliu Notebook" blog, reproduced please be sure to keep this source http://blog.csdn.net/orangleliu/article/details/41044879

Orangleliu


[Linux]linux command to learn-netstat

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.