Commande Ping

Fermé
Oyasumi - 3 nov. 2009 à 16:06
 Oyasumi - 4 nov. 2009 à 10:46
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

lami20j Messages postés 21331 Date d'inscription jeudi 4 novembre 2004 Statut Modérateur, Contributeur sécurité Dernière intervention 30 octobre 2019 3 567
3 nov. 2009 à 18:52
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
Merci beaucoup.
0
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
blux Messages postés 26001 Date d'inscription dimanche 26 août 2001 Statut Modérateur Dernière intervention 24 avril 2024 3 289 > Oyasumi
4 nov. 2009 à 10:03
Salut,

impossible en unix, à ma connaissance...

Les stats sont affichées à la fin des tests.
0
dubcek Messages postés 18718 Date d'inscription lundi 15 janvier 2007 Statut Contributeur Dernière intervention 22 mars 2024 5 615
4 nov. 2009 à 10:13
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
Ca marche, merci !
0