Here is a quick way to ping all the hosts in your host table. NOTE: Just make sure that there are no blank lines in it, and verify the ping command on your system exist after one ping. Your
mileage may differ slightly.
$ grep -v "#" /etc/hosts | awk '{print $1}' | while read host
> do
> ping -c 1 $host
> done
Or script it:
#!/bin/sh
grep -v "#" /etc/hosts | awk '{print $1}' | while read host
do
ping -c 1 $host
done
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment