我想要平一个IP地址60秒。就像在Windows中一样,您可以指定带有“-t”标志的时间。
ping 192.168.1.1 -t60在Linux中有可能吗?
发布于 2017-11-20 14:55:00
来自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.例如。
$ time ping -w60 192.168.1.65 &>/dev/null
real 1m0.001s
user 0m0.008s
sys 0m0.000s发布于 2019-04-19 22:41:07
这里也可以使用超时值命令。它来自Linux中的Coreutils包。该命令将是:
timeout 60 ping google.com就这样。
注意:在这里您可以运行任何有执行时间限制的命令。
https://askubuntu.com/questions/978437
复制相似问题