pingä¸ã«çµ±è¨æ å ±ã表示ããã·ã§ã¼ãã«ããï¼Macã§ãLinuxã§ãWindowsã§ãï¼
pingãæã¡ç¶ãã¦ããæä¸ã«ãå¹³åé 延æéãå¹³åãã¹çãªã©ãç¥ããããã§ãããã§æ¢ãããæåãããããªããããã¬ã¬ãã¨ãã£ãçµé¨ããã¾ãããï¼ããã¾ãããï¼ãï¼
å®ã¯å¤§æµã®pingã³ãã³ãã«ã¯ãpingä¸ã«çµ±è¨æ å ±ã表示ããæ©è½ãå®è£ ããã¦ãã¾ãã
BSDç³»(Mac OS Xå«ã)ã®å ´åãCtrl+t(SIGINFO)ã§
manã«è¨è¼ãããã¾ããã
If ping receives a SIGINFO (see the status argument for stty(1)) signal, the current number of packets sent and received, and the minimum, mean, and maximum of the round-trip times will be written to the standard error output.
SIGINFOãéãã°çµ±è¨æ å ±ã表示ããã¾ããSIGINFOã¯CTRL+tã§éããã¨ãã§ãã¾ã(Mac OS Xæ¨æºã®Terminalã®å ´å)ã
% ping 127.0.0.1 PING 127.0.0.1 (127.0.0.1): 56 data bytes 64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.050 ms 64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.072 ms 64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.082 ms (âããã§CTRL+t) load: 0.22 cmd: ping 22171 running 0.00u 0.00s 3/3 packets received (100.0%) 0.050 min / 0.068 avg / 0.082 max 64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.061 ms
iTermã¯Ctrl+tã§SIGINFOãéãããªãããã§ãããããªå ´åã¯killã³ãã³ãã§éãã¾ãããã
% kill -INFO <pingã®PID>
Linux(iputils)ã®å ´åãCTRL+\(SIGQUIT)ã§
manã«ããã¨ãiputilsã®pingã«ã¯SIGQUITãéãã°ããããã§ãã
Shorter current statistics can be obtained without termination of process with signal SIGQUIT.
ä¸è¬çãªã¿ã¼ããã«ã§ããã°ãCTRL+\ã§SIGQUITãéããã¨ãã§ãã¾ãã
$ ping PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data. 64 bytes from 127.0.0.1: icmp_req=1 ttl=64 time=0.027 ms 64 bytes from 127.0.0.1: icmp_req=2 ttl=64 time=0.025 ms 64 bytes from 127.0.0.1: icmp_req=3 ttl=64 time=0.024 ms (âããã§CTRL+\) 3/3 packets, 0% loss, min/avg/ewma/max = 0.024/0.025/0.026/0.027 ms 64 bytes from 127.0.0.1: icmp_req=4 ttl=64 time=0.030 ms ...
CTRL+\ãå©ããªãå ´åã¯killã³ãã³ãã§ã©ããã
$ kill -QUIT <pingã®PID>
Windowsã®å ´åãCTRL+Breakã§
pingã³ãã³ãã®ãã«ãã«æ¸ããã¦ã¾ããã
> ping Usage: ping [-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v TOS] [-r count] [-s count] [[-j host-list] | [-k host-list]] [-w timeout] target_name Options: -t Ping the specified host until stopped. To see statistics and continue - type Control-Break; To stop - type Control-C.
ãï¼Breakã£ã¦ä½ï¼ãããªãã¼ãã£ãã£ãï¼
ãããããã¾ãããã¼ãã¼ããè¯ãã¿ã¦ãã ãããPrintScreenãã¼ãScrollLockãã¼ã®æ¨ªãããã«Pause/Breakãã¼ãããã¾ãããï¼
ããã§ãããã¼ããã½ã³ã³ã®å ´åãFnãã¼ãæ¼ããªããããããã¾ããã
> ping -t 127.0.0.1 Pinging 127.0.0.1 with 32 bytes of data: Reply from 127.0.0.1: bytes=32 time<1ms TTL=128 Reply from 127.0.0.1: bytes=32 time<1ms TTL=128 Reply from 127.0.0.1: bytes=32 time<1ms TTL=128 Reply from 127.0.0.1: bytes=32 time<1ms TTL=128 Reply from 127.0.0.1: bytes=32 time<1ms TTL=128 Reply from 127.0.0.1: bytes=32 time<1ms TTL=128 (âããã§CTRL+Break) Ping statistics for 127.0.0.1: Packets: Sent = 6, Received = 6, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 0ms, Average = 0ms Control-Break Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
注æ ä¸é¨ã®pingå®è£ ã§ã¯ä½¿ãã¾ããï¼ä¾ãã°busyboxã¨ãï¼
busybox pingã«SIGQUITãéãã¨çµ±è¨æ å ±ãåºããã«å³çµäºãã¦ãã¾ãã®ã§æ³¨æãã¾ãããã
# busybox ping 127.0.0.1 PING 127.0.0.1 (127.0.0.1): 56 data bytes 64 bytes from 127.0.0.1: seq=0 ttl=64 time=0.050 ms 64 bytes from 127.0.0.1: seq=1 ttl=64 time=0.049 ms 64 bytes from 127.0.0.1: seq=2 ttl=64 time=0.056 ms (âããã§CTRL+\) # (âçµ±è¨æ å ±ã¯è¡¨ç¤ºãããããã³ããã«æ»ã£ã)
ä»ã«ãddã³ãã³ãã§USR1ã¨ã
ddã³ãã³ãã«SIGUSR1ãéãã¨éä¸çµéã表示ãããã¨ãã§ãã¾ãã
ã³ãã³ãã«ãã£ã¦ä½ãéãã¹ããã¯ç°ãªãã®ã§ããããã調ã¹ã¦ãã使ãã¾ãããã