Files
tldr/pages.zh/linux/ttyplot.md

20 lines
619 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# ttyplot
> 一个用于命令行的实时绘图工具,数据输入来自 `stdin`。
> 更多信息:<https://github.com/tenox7/ttyplot>。
- 绘制值 `1``2``3` `cat` 防止 ttyplot 退出):
`{ echo {{1 2 3}}; cat } | ttyplot`
- 设置特定的标题和单位:
`{ echo {{1 2 3}}; cat } | ttyplot -t {{标题}} -u {{单位}}`
- 使用 while 循环连续绘制随机值:
`{ while {{true}}; do echo {{$RANDOM}}; sleep {{1}}; done } | ttyplot`
- 解析 `ping` 的输出并可视化:
`ping {{8.8.8.8}} | sed -u '{{s/^.*time=//g; s/ ms//g}}' | ttyplot -t "{{ping to 8.8.8.8}}" -u {{毫秒}}`