How can I write a Linux bash script that tells me which computers are ON in my LAN?

前端 未结 16 1561
攒了一身酷
攒了一身酷 2020-12-12 11:59

How can I write a Linux Bash script that tells me which computers are ON in my LAN?

It would help if I could give it a range of IP addresses as input.

16条回答
  •  眼角桃花
    2020-12-12 12:43

    Just for fun, here's an alternate

         #!/bin/bash
         nmap -sP 192.168.1.0/24 > /dev/null 2>&1 && arp -an | grep -v incomplete | awk '{print$2}' | sed -e s,\(,, | sed -e s,\),,
    

提交回复
热议问题