Commande Ping

Bonjour,

Il existe sur windows une combinaison de touches (Ctrl+Pause) pour afficher les statistiques d'un ping, sans pour autant arrêter complètement le ping en cours.

C'est très utile et j'aimerai savoir s'il existe la même chose sur Linux.

Merci.

4 réponses

  1. Modérateur
    Salut,

    CTRL+Z sous linux
    Pour reprendre il faut taper fg
    Pour arrêter CTRL+C s'il est en train de tourner en avant-plan
    lami20j@debian:~$ ping localhost
    PING localhost (127.0.0.1) 56(84) bytes of data.
    64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.075 ms
    64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.079 ms
    ^Z
    [1]+  Stopped                 ping localhost
    lami20j@debian:~$ fg
    ping localhost
    64 bytes from localhost (127.0.0.1): icmp_seq=3 ttl=64 time=0.075 ms
    64 bytes from localhost (127.0.0.1): icmp_seq=4 ttl=64 time=0.075 ms
    64 bytes from localhost (127.0.0.1): icmp_seq=5 ttl=64 time=0.076 ms
    64 bytes from localhost (127.0.0.1): icmp_seq=6 ttl=64 time=0.076 ms
    ^C
    --- localhost ping statistics ---
    6 packets transmitted, 6 received, 0% packet loss, time 7963ms
    rtt min/avg/max/mdev = 0.075/0.076/0.079/0.001 ms
    lami20j@debian:~$
    

    Pour arrêter s'il tourne en arrière plan kill %NuméroJob
    lami20j@debian:~$ ping localhost
    PING localhost (127.0.0.1) 56(84) bytes of data.
    64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.073 ms
    64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.069 ms
    ^Z
    [1]+  Stopped                 ping localhost
    lami20j@debian:~$ fg
    ping localhost
    64 bytes from localhost (127.0.0.1): icmp_seq=3 ttl=64 time=0.076 ms
    64 bytes from localhost (127.0.0.1): icmp_seq=4 ttl=64 time=0.072 ms
    64 bytes from localhost (127.0.0.1): icmp_seq=5 ttl=64 time=0.076 ms
    ^Z
    [1]+  Stopped                 ping localhost
    lami20j@debian:~$ jobs
    [1]+  Stopped                 ping localhost
    lami20j@debian:~$ kill %1
    
    [1]+  Stopped                 ping localhost
    lami20j@debian:~$
    [1]+  Complété                ping localhost
    lami20j@debian:~$
    


    Pour savoir le numéro du job tu tapes la commande jobs
    0
    1. Merci beaucoup.
      0
      1. Ah ouai mais non en fait :P

        Le problème c'est qu'il ne m'affiche pas les statistiques du ping pendant la pause.

        Pas comme le Ctrl+Pause de Windows.
        0
      2. Modérateur
        @OyasumiSalut,

        impossible en unix, à ma connaissance...

        Les stats sont affichées à la fin des tests.
        0
    2. Contributeur
      hello
      si tu tapes un SIGQUIT :
      ctrl+\
      ping affiche une ligne de statistiques sans s'interrompre

      $ ping www.google.com
      PING www.l.google.com (74.125.43.103) 56(84) bytes of data.
      64 bytes from bw-in-f103.1e100.net (74.125.43.103): icmp_seq=1 ttl=53 time=35.1 ms
      64 bytes from bw-in-f103.1e100.net (74.125.43.103): icmp_seq=2 ttl=53 time=34.2 ms
      64 bytes from bw-in-f103.1e100.net (74.125.43.103): icmp_seq=3 ttl=53 time=35.3 ms
      64 bytes from bw-in-f103.1e100.net (74.125.43.103): icmp_seq=4 ttl=53 time=34.0 ms
      64 bytes from bw-in-f103.1e100.net (74.125.43.103): icmp_seq=5 ttl=53 time=34.5 ms
      5/5 packets, 0% loss, min/avg/ewma/max = 34.046/34.669/34.907/35.371 ms
      64 bytes from bw-in-f103.1e100.net (74.125.43.103): icmp_seq=6 ttl=53 time=36.6 ms
      64 bytes from bw-in-f103.1e100.net (74.125.43.103): icmp_seq=7 ttl=53 time=37.4 ms
      64 bytes from bw-in-f103.1e100.net (74.125.43.103): icmp_seq=8 ttl=53 time=35.9 ms
      64 bytes from bw-in-f103.1e100.net (74.125.43.103): icmp_seq=9 ttl=53 time=35.8 ms
      0