dongnan
总版主
总版主
  • 粉丝52
  • 发帖数2147
  • 铜币12705枚
  • 威望5681点
  • 银元150个
  • 社区居民
  • 最爱沙发
  • 忠实会员
  • 原创写手
阅读:294回复:0

pv 命令

楼主#
更多 发布于:2018-03-13 16:59
例子
结合 ssh 与 pv 命令,利用 Linux 的管道,可以将 Docker 镜像从一个机器迁移到另一个机器,并且带进度条的功能
docker save hello-world | gzip | pv | ssh  root@192.168.1.2x 'cat | docker load'

帮助
man pv

NAME
       pv - monitor the progress of data through a pipe

SYNOPSIS
       pv [OPTION] [FILE]...
       pv [-h|-V]

DESCRIPTION
       pv  allows  a  user to see the progress of data through a pipeline, by giving information such as time elapsed, percentage completed
       (with progress bar), current throughput rate, total data transferred, and ETA.

       To use it, insert it in a pipeline between two processes, with the appropriate options.  Its standard input will be  passed  through
       to its standard output and progress will be shown on standard error.

       pv  will  copy  each  supplied  FILE in turn to standard output (- means standard input), or if no FILEs are specified just standard
       input is copied. This is the same behaviour as cat(1).

#
游客

返回顶部