Linux 2 commands for checking TCP connections _linux shell

Source: Internet
Author: User

1 detect the number and status of links to the Web server:

Netstat-ant|awk ' {print $ \ t ' $} ' |grep:: FFFF: ' |sed-e ' s/::ffff://'-e ' s/:[0-9]*//' |sort|uniq-c| Sort-rn|head-10

Results:
122 125.162.71.199 time_wait
79.119.125.43 time_wait
Bayi 125.167.243.77 time_wait
110.137.106.75 time_wait
118.97.140.166 time_wait
115.192.138.175 time_wait
70.231.252.244 time_wait
114.58.168.27 time_wait
219.95.10.58 time_wait
125.160.90.214 time_wait


detects the number and status of all TCP connections

Netstat-ant|awk ' {print $ \ t ' $} ' |grep ' [1-9][0-9]*\. ' | Sed-e ' s/::ffff://'-e ' s/:[0-9]*//' |sort|uniq-c|sort-nr|head-10

Result:
143 79.119.125.43 time_wait
time_wait 125.162.71.199
52 time_wait Time_wait
114.79.21.172 time_wait
118.97.140.166 time_wait
70.231.252.244 time_wait
19 114.58 .168.27 time_wait
219.95.10.58 time_wait
115.192.138.175 time_wait

Friends who are in need can take a collection

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.