Linux 使用 dd 查看日志增长速度、方法每秒执行次数
Linux 大约 593 字查看日志增长速度
of
:输出到/dev/null
黑洞中。
status=progress
:显示速度。
tail -f test.log | dd of=/dev/null status=progress
输出
root@local:~# tail -f test.log | dd of=/dev/null status=progress
0 bytes copied, 21 s, 0.0 kB/s
查看方法每秒执行次数
tail -f test.log | grep --line-buffered "/api/user/info" | stdbuf -oL tr -dc '\n' | dd of=/dev/null bs=1 status=progress
测试命令,每隔一秒钟写入日志文件
while true; do echo "/api/user/info" >> test.log; sleep 1s; done
输出
root@local:~# tail -f test.log | grep --line-buffered "/api/user/info" | stdbuf -oL tr -dc '\n' | dd of=/dev
/null bs=1 status=progress
49 bytes copied, 252 s, 0.0 kB/s
阅读 507 · 发布于 2022-06-21
————        END        ————
Give me a Star, Thanks:)
https://github.com/fendoudebb扫描下方二维码关注公众号和小程序↓↓↓

昵称: