Introduction to the netstat command in linux

Source: Internet
Author: User
Introduction to netstat commands in linux: www.2cto. the comNetstat command is used to display various network-related information, such as network connection, route table, interface status (InterfaceStatistics), masquerade connection, and multicast member (MulticastMemberships .... Introduction to netstat commands in linux: the Netstat command www.2cto.com is used to display various network-related information, such as network connection, route table, Interface status (Interface Statistics), masquerade connection, and Multicast member (Multicast Memberships) and so on. Common parameters-a (all) show all options. by default, LISTEN-t (tcp) is not displayed. only tcp-related options-u (udp) are displayed) only show udp-related options-n decline display alias, can show all the numbers into numbers. -L only list servers with Listen (Listener? MB? Nbsp;-p: the program name that establishes the relevant link-r: The route information is displayed, and route table-e: the extended information is displayed, for example, uid and other-s are counted according to each protocol.-c runs the netstat command at every fixed time. Tip: The LISTEN and LISTENING statuses can only be seen with-a or-l. list all ports (including listeners and ports not listened) list all ports netstat-a Java code netstat-a | more list all tcp ports netstat-at Java code netstat-at list all udp ports netstat-at Java code netstat-au 2. list all Sockets in listening status only display listening port netstat-l Java code netstat-l only list all listening tcp ports netstat-lt Java code netstat-lt only list all listening udp ports netstat -lu Java code netstat-lu only lists all listening UNIX ports netstat-lx Java code netstat-lx 3. show each Protocol Statistics display statistics of all ports netstat-s Java code netstat-s display statistics of TCP or UDP ports netstat-st or-su Java code netstat-st netstat-su 4. in the netstat output, the PID and process name netstat-p can be used with other switches to add the "PID/process name" to the netstat output, in this way, you can easily find programs running on specific ports during debugging. Java code netstat-pt 5. the host, port, and user name (host, port or user) are not displayed in the netstat output. when you do not want to display the host, port, and user name, use netstat-n. The names will be replaced by numbers. The output can also be accelerated because comparison queries are not required. Java code netstat-an 6. not all processes can find the port where the program runs. if you do not have the permission, it will not be displayed. you can use the root permission to view all the information. Java code netstat-antlp | grep smb find the process running on the specified port Java code netstat-anpl | grep ': 22'
Related Article

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.