Veja man ping
-c count
Pare após enviar os pacotes de contagem ECHO_REQUEST. Com prazo opção, o ping aguarda a contagem de pacotes ECHO_REPLY, até o momento expira.
$ ping www.google.nl -c 5 PING www.l.google.com (66.102.13.104) 56(84) bytes of data. 64 bytes from ez-in-f104.1e100.net (66.102.13.104): icmp_req=1 ttl=53 time=18.4 ms 64 bytes from ez-in-f104.1e100.net (66.102.13.104): icmp_req=2 ttl=53 time=18.8 ms 64 bytes from ez-in-f104.1e100.net (66.102.13.104): icmp_req=3 ttl=53 time=15.1 ms 64 bytes from ez-in-f104.1e100.net (66.102.13.104): icmp_req=4 ttl=54 time=16.8 ms 64 bytes from ez-in-f104.1e100.net (66.102.13.104): icmp_req=5 ttl=54 time=19.6 ms --- www.l.google.com ping statistics --- 5 packets transmitted, 5 received, 0% packet loss, time 4005ms rtt min/avg/max/mdev = 15.133/17.781/19.660/1.615 ms