If I remember correctly , in Solaris , ping will return “alive” or “dead” by default. But in linux no such feature/option anymore , we must using script or other tools to do this ,below is a simple bash script to show remote host or ip address is “alive” or “dead”

1.Create a new file with your favorite editor like vim /gvim /nano, here we use gvim and name the script as ping.sh

gvim ping.sh

2.Put below code into this file and save it

if ping -c 1 -W 1 "$1" &>/dev/null; then
  echo "$1 is alive"
  echo "$1 is dead"

“&” lets ping to run in background , “>/dev/null” suppress some outputs of ping.Note: there is no space between “&” and “>”

3.Add execution access for this file

chmod +x ping.sh

4.Now you can use script ping.sh to check remote host is alive or dead

[j@localhost ~]$ cat hosts.txt
[j@localhost ~]$ for host in `cat hosts.txt`;do /home/j/ping.sh $host;done is alive
www.google.com is dead is dead
www.yutuble.com is dead
www.yahoo.com is alive
[j@localhost ~]$