Ping por 60 segundos

5

Eu quero pingar um endereço IP por 60 segundos. Como no Windows, você especifica a hora com o sinalizador '-t'.

ping 192.168.1.1 -t60

É possível no Linux?

    
por mgmihir 20.11.2017 / 15:49

1 resposta

17

De man ping

   -w deadline
          Specify  a  timeout, in seconds, before ping exits regardless of
          how many packets have been sent or received. In this  case  ping
          does  not  stop after count packet are sent, it waits either for
          deadline expire or until count probes are answered or  for  some
          error notification from network.

ex.

$ time ping -w60 192.168.1.65 &>/dev/null

real    1m0.001s
user    0m0.008s
sys     0m0.000s
    
por steeldriver 20.11.2017 / 15:55