linux pv命令,pv命令_Linux pv命令使用详解:用来度量执行命令的具体信息

pv是一个用于监控文件或管道数据传输的工具,它可以显示进度条、时间、速率等信息。默认情况下,pv会显示进度、时间和速率。通过参数如-size指定数据大小,-r显示速率,-e估算完成时间。注意,对于目录操作,pv无法直接获取总大小。此外,pv还能限制数据传输速率,并忽略输入错误。在没有总大小的情况下,进度条会移动但无法计算完成百分比。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

pv命令可以用来度量执行命令的具体信息:时间,进度等。可以是管道的过程进度对用户透明,可以监控长时间操作的执行情况。

pv参数详解

Usage: pv [OPTION] [FILE]…

Concatenate FILE(s), or standard input, to standard output,with monitoring.

-p, –progress

show progress bar

显示进度条(目测不是很准的样子==)(默认)

-t, –timer

show elapsed time

显示任务已经进行的时长(默认)

-e, –eta

show 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

-F, –format FORMAT

set output format to FORMAT

-n, –numeric

output percentages, not visual information

显示进度百分比

-q, –quiet

do not output any transfer information at all

不输出任何信息

-W, –wait

display nothing until first byte transferred

-s, –size SIZE

set estimated data size to SIZE bytes

-l, –line-mode

count lines instead of bytes

-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

限制每秒的传输速率,RATE可为n,nK,nM,nG

-B, –buffer-size BYTES

use a buffer size of BYTES

-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

-h, –help

show this help and exit

-V, –version

show version information and exit

在默认情况下,pv命令会显示它能够计算出值的所有状态指标。例如,如果 pv 的输入不是文件,也没有手工指定大小,进度条会从左到右移动以表示有活动,但是由于没有总大小,它无法计算出已经完成的百分比。另外,pv命令可以限制硬盘的io速度。

需要注意的是:如果是对目录的操作,pv不能直接获得全部的大小。需要指定size或者计算目录大小。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值