美文网首页
Linux 实用命令 - pv

Linux 实用命令 - pv

作者: Anoyi | 来源:发表于2019-10-30 22:12 被阅读0次

pv 是 Pipe Viewer 的简称,由 Andrew Wood 开发,意思是通过管道显示数据处理进度的信息,这些信息包括已经耗费的时间、完成的百分比、当前的速度、全部传输的数据以及估计剩余的时间。

Install

# Debian 系,如 Ubuntu
apt-get install pv

# RedHat 系,如 CentOS:
yum install pv

Usage

pv [OPTION] [FILE]...

Options

-p, --progress           show progress bar
-t, --timer              show elapsed time
-e, --eta                show estimated time of arrival (completion)
-I, --fineta             show absolute estimated time of arrival
                         (completion)
-r, --rate               show data transfer rate counter
-a, --average-rate       show data transfer average rate counter
-b, --bytes              show number of bytes transferred
-T, --buffer-percent     show percentage of transfer buffer in use
-A, --last-written NUM   show NUM bytes last written
-F, --format FORMAT      set output format to FORMAT
-n, --numeric            输出百分比
-q, --quiet              do not output any transfer information at all

-W, --wait               display nothing until first byte transferred
-D, --delay-start SEC    display nothing until SEC seconds have passed
-s, --size SIZE          set estimated data size to SIZE bytes
-l, --line-mode          count lines instead of bytes
-0, --null               lines are null-terminated
-i, --interval SEC       update every SEC seconds
-w, --width WIDTH        assume terminal is WIDTH characters wide
-H, --height HEIGHT      assume terminal is HEIGHT rows high
-N, --name NAME          prefix visual information with NAME
-f, --force              output even if standard error is not a terminal
-c, --cursor             use cursor positioning escape sequences

-L, --rate-limit RATE    limit transfer to RATE bytes per second
-B, --buffer-size BYTES  use a buffer size of BYTES
-C, --no-splice          never use splice(), always use read/write
-E, --skip-errors        skip read errors in input
-S, --stop-at-size       stop after --size bytes have been transferred
-R, --remote PID         update settings of process PID

-P, --pidfile FILE       save process ID in FILE

-d, --watchfd PID[:FD]   watch file FD opened by process PID

-h, --help               显示帮助
-V, --version            显示版本信息

Demo

复制文件

pv ~/Downloads/CentOS-7-x86_64-Minimal-1511.iso > ~/Desktop/CentOS-7-x86_64-Minimal-1511.iso

复制文件(限速2MB/s)*

pv -L 2m ~/Downloads/CentOS-7-x86_64-Minimal-1511.iso > ~/Desktop/CentOS-7-x86_64-Minimal-1511.iso

复制文件夹*

SRC="/data"; TRG="/data1"; tar cf - "$SRC" | pv -s $(du -sb "$SRC" | cut -f1) | tar xf - -C "$TRG"

相关文章

  • Linux 实用命令 - pv

    pv 是 Pipe Viewer 的简称,由 Andrew Wood 开发,意思是通过管道显示数据处理进度的信息,...

  • linux下实时查看tomcat运行日志

    实用命令: Linux查看日志命令总结

  • Linux实用命令

    Linux实用命令 前面已经说过,我们学习Linux,最基础的就是要掌握Linux实用命令的使用,这对提高我们的生...

  • linux lv pv lv 命令

    将/dev/sdb物理卷添加到VolGroup卷组中。(扩展卷组前,最好还是先查看下卷组名,VolGroup是Ce...

  • 【git】git实用基本概念 git add git comm

    git使用要从官网下载 .exe文件安装实用,实用Linux命令,(why,因为git的创始人就是Linux的创始...

  • 文件安全性保障-chattr

    不常见但是很实用且高级的linux命令chattr。该命令的作用是改变linux文件的属性(change attr...

  • 常用linux命令拾遗(1)

    Linux下面命令多,功能强大,平时重在积累,用时事半功倍。举例几个实用的Linux命令 1、关闭进程 比较冗长的...

  • 实用linux命令

    拷包到其他机器 linux下面将某个文件发送到另外一台linux机器 从远程服务器复制到本地服务器:从远程复制到本...

  • 实用linux命令

    常用的别名

  • Linux实用命令汇总

    Linux实用型命令汇总 Linux在vi/vim中搜索关键词 1、在命令模式下敲斜杆( / ),然后输入需要查找...

网友评论

      本文标题:Linux 实用命令 - pv

      本文链接:https://www.haomeiwen.com/subject/rxdavctx.html