The shell checks the IP usage in the network segment and counts

Source: Internet
Author: User

#!/bin/bash# Beijing Linux Technology Exchange Group: 76109360n=0s=0for ((i=1; I <=; i++)) do if ping-c 1-w 1 192.168.1. $i >/dev/null; Then Echo-e "\033[31m192.168.1. $i yes\033[0m" Let n= $n +1 else Echo-e "\033[32m192.168.1. $i No 33[0m "Let s= $s +1 fidone echo" $n Yes, $s no "

Note: The ping parameter explanation    

-C: Number of messages

-W: Timeout for response messages


This article is from the "Chun Blog" blog, please be sure to keep this source http://ssc4469.blog.51cto.com/6315913/1605104

The shell checks the IP usage in the network segment and counts

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.