小编Tho*_*mas的帖子

为什么“ping”在重定向输出时不输出摘要?

我可以 ping google.com几秒钟,当我按Ctrl+时C,底部会显示一个简短的摘要:

$ ping google.com
PING google.com (74.125.131.113) 56(84) bytes of data.
64 bytes from lu-in-f113.1e100.net (74.125.131.113): icmp_seq=2 ttl=56 time=46.7 ms
64 bytes from lu-in-f113.1e100.net (74.125.131.113): icmp_seq=3 ttl=56 time=45.0 ms
64 bytes from lu-in-f113.1e100.net (74.125.131.113): icmp_seq=4 ttl=56 time=54.5 ms
^C
--- google.com ping statistics ---
4 packets transmitted, 3 received, 25% packet loss, time 3009ms
rtt min/avg/max/mdev = 44.965/48.719/54.524/4.163 ms
Run Code Online (Sandbox Code Playgroud)

但是,当我使用 执行相同的重定向输出到日志文件时tee,不会显示摘要:

$ ping google.com | tee log
PING google.com (74.125.131.113) 56(84) …
Run Code Online (Sandbox Code Playgroud)

linux signals ping tee

30
推荐指数
2
解决办法
3255
查看次数

bash 文件名扩展(通配)是否有最大值,如果是,它是什么?

bash 文件名扩展(通配)是否有最大值,如果是,它是什么?见通配符的tldp.org。

假设我想对文件子集运行命令:

grep -e bar foo*
rm -f bar*
Run Code Online (Sandbox Code Playgroud)

bash 将扩展到多少个文件是否有限制,如果有,它是什么?

我不是在寻找执行这些操作的替代方法(例如,通过使用find)。

bash wildcards bash-expansion

15
推荐指数
2
解决办法
4014
查看次数

标签 统计

bash ×1

bash-expansion ×1

linux ×1

ping ×1

signals ×1

tee ×1

wildcards ×1