加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

osx – 如何让dd在MacOS中打印传输统计信息?

发布时间:2020-12-16 01:25:11 所属栏目:安全 来源:网络整理
导读:对于MacOS(Mavericks),我正在制作一个 shell脚本,以便随着时间的推移收集传输统计信息,用于命令dd. 手册页面说: If dd receives a SIGINFO (see the status argument for stty(1)) signal, the current input and output block counts will be written to t
对于MacOS(Mavericks),我正在制作一个 shell脚本,以便随着时间的推移收集传输统计信息,用于命令dd.

手册页面说:

If dd receives a SIGINFO (see the status argument for stty(1)) signal,
the current input and output block counts will be written to the
standard error output in the same format as the standard completion
message.

因此,就像在Linux中,我试过:

kill -INFO <pid_of_dd>

该命令成功完成状态0,但是dd进程连接到的终端,标准输出/标准错误中没有统计信息.

那么,让dd在其输出中打印统计信息的正确方法是什么?

这似乎对我有用:
$dd if=/dev/zero of=/dev/null bs=1k &
[1] 33990
$kill -INFO 33990
4787784+0 records in
4787784+0 records out
4902690816 bytes transferred in 4.260769 secs (1150658706 bytes/sec)
$kill -INFO 33990
8357846+0 records in
8357846+0 records out
8558434304 bytes transferred in 7.428820 secs (1152058392 bytes/sec)
$kill 33990
$ps
  PID TTY           TIME CMD
 1342 ttys000    0:00.02 -bash
 2290 ttys001    0:00.17 -bash
[1]+  Terminated: 15          dd if=/dev/zero of=/dev/null bs=1k
$

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读