@@ -27,42 +27,42 @@ pv [OPTION] [FILE]...
2727### 选项
2828
2929``` shell
30- -p, --progress show progress bar
31- -t, --timer show elapsed time
32- -e, --eta show estimated time of arrival (completion )
33- -I, --fineta show absolute estimated time of arrival
34- (completion )
35- -r, --rate show data transfer rate counter
36- -a, --average-rate show data transfer average rate counter
37- -b, --bytes show number of bytes transferred
38- -T, --buffer-percent show percentage of transfer buffer in use
39- -A, --last-written NUM show NUM bytes last written
40- -F, --format FORMAT set output format to FORMAT
30+ -p, --progress 显示进度条
31+ -t, --timer 显示已用时间
32+ -e, --eta 显示预计到达时间 (完成 )
33+ -I, --fineta 显示绝对估计到达时间
34+ (完成 )
35+ -r, --rate 显示数据传输速率计数器
36+ -a, --average-rate 显示数据传输平均速率计数器
37+ -b, --bytes 显示传输的字节数
38+ -T, --buffer-percent 显示正在使用的传输缓冲区百分比
39+ -A, --last-written NUM 显示上次写入的字节数
40+ -F, --format FORMAT 将输出格式设置为FORMAT
4141-n, --numeric 输出百分比
42- -q, --quiet do not output any transfer information at all
43-
44- -W, --wait display nothing until first byte transferred
45- -D, --delay-start SEC display nothing until SEC seconds have passed
46- -s, --size SIZE set estimated data size to SIZE bytes
47- -l, --line-mode count lines instead of bytes
48- -0, --null lines are null-terminated
49- -i, --interval SEC update every SEC seconds
50- -w, --width WIDTH assume terminal is WIDTH characters wide
51- -H, --height HEIGHT assume terminal is HEIGHT rows high
52- -N, --name NAME prefix visual information with NAME
53- -f, --force output even if standard error is not a terminal
54- -c, --cursor use cursor positioning escape sequences
55-
56- -L, --rate-limit RATE limit transfer to RATE bytes per second
57- -B, --buffer-size BYTES use a buffer size of BYTES
58- -C, --no-splice never use splice (), always use read/write
59- -E, --skip-errors skip read errors in input
60- -S, --stop-at-size stop after --size bytes have been transferred
61- -R, --remote PID update settings of process PID
62-
63- -P, --pidfile FILE save process ID in FILE
64-
65- -d, --watchfd PID[:FD] watch file FD opened by process PID
42+ -q, --quiet 不输出任何信息
43+
44+ -W, --wait 在传输第一个字节之前不显示任何内容
45+ -D, --delay-start SEC 在SEC秒过去之前不显示任何内容
46+ -s, --size SIZE 将估算的数据大小设置为SIZE字节
47+ -l, --line-mode 计算行数而不是字节数
48+ -0, --null 行以零结尾
49+ -i, --interval SEC 每SEC秒更新一次
50+ -w, --width WIDTH 假设终端的宽度为WIDTH个字符
51+ -H, --height HEIGHT 假设终端高度为HEIGHT行
52+ -N, --name NAME 在可视信息前面加上名称
53+ -f, --force 将标准错误输出到终端
54+ -c, --cursor 使用光标定位转义序列
55+
56+ -L, --rate-limit RATE 将传输限制为每秒RATE字节
57+ -B, --buffer-size BYTES 使用BYTES的缓冲区大小
58+ -C, --no-splice 从不使用splice (),始终使用读/写
59+ -E, --skip-errors 跳过输入中的读取错误
60+ -S, --stop-at-size 传输--size字节后停止
61+ -R, --remote PID 更新过程PID的设置
62+
63+ -P, --pidfile FILE 将进程ID保存在FILE中
64+
65+ -d, --watchfd PID[:FD] 监视进程PID,打开的文件FD
6666
6767-h, --help 显示帮助
6868-V, --version 显示版本信息
@@ -99,4 +99,9 @@ sudo pv -cN source < /Users/kacperwang/Downloads/CentOS-7-x86_64-Everything-1511
9999source: 5.2GiB 5:11:41 [ 503KiB/s] [=====================> ] 71% ETA 2:01:56
100100```
101101
102+ 在linux上, 如果执行的一些命令或者一些脚本需要花费很长时间, 但又不能拿出更多的精力反复盯着有没有执行结束, 这时候可以用pv监听PID, 任务完成后通过网络通知到微信或者钉钉, 这样就可以腾出来精力做其他的事, 是不是很棒
103+
104+ ``` shell
105+ $ pv -d $( ps -ef | grep -v grep | grep " <脚本或命令的关键字>" | awk ' {print $2}' ) && < 这里执行发通知脚本或者命令,脚本或命令需要提前调试好>
106+ ```
102107<!-- Linux命令行搜索引擎:https://jaywcjlove.github.io/linux-command/ -->
0 commit comments