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

前端 未结 16 1558
攒了一身酷
攒了一身酷 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条回答
  •  萌比男神i
    2020-12-12 13:04

    There is also fping:

    fping -g 192.168.1.0/24
    

    or:

    fping -g 192.168.1.0 192.168.1.255
    

    or show only hosts that are alive:

    fping -ag 192.168.1.0/24
    

    It pings hosts in parallel so the scan is very fast. I don't know a distribution which includes fping in its default installation but in most distributions you can get it through the package manager.

提交回复
热议问题