pv: 管道查看器

管道是 Linux 的 Shell 里面用的很多的东西,利用 pv 这个软件,可以查看通过管道的内容的流量和大小等等,然后用于统计显示。

例如:

pv <example.tgz|tar zxf -

可以显示解包的进度。

另外一个例子:

tar cf - /usr |pv|gzip >/tmp/usr.tgz

可以显示压缩的进度。

详细的介绍看这里

Read More:

15 Comments

  1. 1 entertainyou Commented @ 2009-12-09 16:29Reply to this comment

    沙发

    貌似是个好工具

  2. 2 simsilver Commented @ 2009-12-09 17:06Reply to this comment

    好东西

    那要是复制文件的话可不可以用 cat file1 |pv>file2 应该有更好的办法吧

  3. 3 自由建客 Commented @ 2009-12-09 17:07Reply to this comment

    剖析一下源码

  4. 4 hmy Commented @ 2009-12-09 17:43Reply to this comment

    @simsilver 可以pv 2.file

  5. 5 hmy Commented @ 2009-12-09 17:44Reply to this comment

    被过滤了 : "pv \2.file "

  6. 6 hmy Commented @ 2009-12-09 17:45Reply to this comment

    pv 本身有 cat的功能 看看官方网站的首页演示或者manpage http://www.ivarch.com/programs/pv.shtml

  7. 7 Yeqin_Su Commented @ 2009-12-09 19:11Reply to this comment

    学习了……

  8. 8 聚焦深空 Commented @ 2009-12-09 20:19Reply to this comment

    不错的小工具。 与他人交互时使用更合适,比如两人的终端用 screen 绑定在一起时。 后台 和 脚本 等 非交互环境使用会有些多余。

  9. 9 b4283 Commented @ 2009-12-09 21:59Reply to this comment

    個人一般用在 tar.gz 解壓縮,十分方便而且明瞭。

  10. 10 transtone Commented @ 2009-12-10 8:27Reply to this comment

    怎么toy上喜欢“借用”TX的文章了?

  11. 11 hmy Commented @ 2009-12-10 8:53Reply to this comment

    @transtone 这文章是我在ibm 看到后投递的, ps; TX是啥?

  12. 12 transtone Commented @ 2009-12-10 9:33Reply to this comment

    sorry。好几篇文章都是tx在推上先介绍了,然后就在toy出现了,兄弟可以说明一下来源于ibm-developer.

  13. 13 transtone Commented @ 2009-12-10 9:34Reply to this comment

    ps: tx的站, imtx.cn

  14. 14 guolinux Commented @ 2009-12-11 8:16Reply to this comment

    好东西,学习了!

  15. 15 fcicq Commented @ 2009-12-16 17:40Reply to this comment

    ms cpipe 功能也差不多.