TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Pipe Viewer

183 pointsby 0x45696e6172over 2 years ago

16 comments

dangover 2 years ago
Related:<p><i>PV (Pipe Viewer) – add a progress bar to most command-line programs</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=23826845" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=23826845</a> - July 2020 (2 comments)<p><i>A Unix Utility You Should Know About: Pipe Viewer</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=8761094" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=8761094</a> - Dec 2014 (1 comment)<p><i>Pipe Viewer</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=5942115" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=5942115</a> - June 2013 (1 comment)<p><i>Pipe Viewer</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=4020026" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=4020026</a> - May 2012 (26 comments)<p><i>A Unix Utility You Should Know About: Pipe Viewer</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=462244" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=462244</a> - Feb 2009 (63 comments)
londons_exploreover 2 years ago
It would be nice to indicate if the upstream or the downstream is the &#x27;limiting&#x27; factor in speed.<p>Ie. within pv, is it the reading the input stream or the writing the output stream that is blocking most of the time?
评论 #33269580 未加载
评论 #33267254 未加载
评论 #33264386 未加载
评论 #33266290 未加载
michaelmiorover 2 years ago
Probably my favorite non-POSIX tool that I insert into my pipelines whenever anything takes more than a few second. I find it super helpful to avoid premature optimization. If I can quickly see that my hacked together pipeline will run in a few minutes and I only ever need to do that once, I&#x27;ll probably just let it finish. If it&#x27;s going to take a few hours, I might decide it&#x27;s worth optimizing.<p>It also helps me optimize my time. If something is going to finish in a few minutes, I probably won&#x27;t context switch to another major task. However, if something is going to take a few hours then I&#x27;ll probably switch to work on something different knowing approximately when I can go back and check on results.
评论 #33265774 未加载
JayGueretteover 2 years ago
pv is a great tool. One of it&#x27;s lesser known features is throttling; transfer a file without dominating your bandwidth:<p>pv -L 200K &lt; bigfile.iso | ssh somehost &#x27;cat &gt; bigfile.iso&#x27;<p>Complete with a progress bar, speed, and ETA.
评论 #33263054 未加载
评论 #33268738 未加载
cwilluover 2 years ago
pv -d $(pidof xz):1 is great for when you realize too late that something is slow enough that you want a progress indication, and definitely do not want to restart from scratch.
评论 #33264519 未加载
评论 #33263246 未加载
derefrover 2 years ago
As a person who runs a lot of ETL-like commands at work, I never find myself using pv(1). I love the idea of it, but for the commands I most want to measure progress of, they always seem to be either:<p>1. things where I&#x27;d be paranoid about pv(1) itself becoming the bottleneck in the pipeline — e.g. dd(1) of large disks where I&#x27;ve explicitly set a large blocksize and set conv=idirect&#x2F;odirect, to optimize throughput.<p>2. things where the program has some useful cleverness I rely on that requires being fed by a named file argument, but behaves a lot less intelligently when being fed from stdin — e.g. feeding SQL files into psql(1).<p>3. things where the program, even while writing to stdout, also produces useful &quot;sampled progress&quot; informational messages on stderr, which I&#x27;d like to see; where pv(1) and this output logging would fight each-other if both were running.<p>4. things where there&#x27;s no clean place to insert pv(1) anyway — mostly, this comes up for any command that manages jobs itself in order to do things in parallel, e.g. any object-storage-client mass-copy, or any parallel-rsync script. (You&#x27;d think these programs would also report global progress, but they usually don&#x27;t!)<p>I could see pv(1) being fixed to address case 3 (by e.g. drawing progress while streaming stderr-logged output below it, using a TUI); but the other cases seem to be fundamental limitations.<p>Personally, when I want to observe progress on some sort of operation that&#x27;s creating files (rsync, tar&#x2F;untar, etc), here&#x27;s what I do instead: I run the command-line, and then, in a separate terminal connected to the machine the files are being written&#x2F;unpacked onto, I run this:<p><pre><code> # for files watch -n 2 -- ls -lh $filepath # for directories watch -n 4 -- du -h -d 0 $dirpath </code></pre> If I&#x27;m in a tmux(1) session, I usually run the file-copying command in one pane, and then create a little three-vertical-line pane below it to run the observation command.<p>Doing things this way doesn&#x27;t give you a percentage progress, but I find that with most operations I already know what the target&#x27;s goal size is going to be, so all I really need to know is the size-so-far. (And pv(1) can&#x27;t tell you the target size in many cases anyway.)
评论 #33268031 未加载
评论 #33266449 未加载
评论 #33267938 未加载
评论 #33264809 未加载
评论 #33265667 未加载
trabant00over 2 years ago
I&#x27;ve used it mostly to measure events per second with something like:<p><pre><code> tail -f &#x2F;some&#x2F;log | grep something | pv -lr &gt; &#x2F;dev&#x2F;null or tcpdump expression | pv -lr &gt; &#x2F;dev&#x2F;null</code></pre>
heinrich5991over 2 years ago
`progress` is also a nice tool to see progress of programs operating linearly on a single file. A lot of tools do that!
pkruminsover 2 years ago
I wrote a pv tutorial: <a href="https:&#x2F;&#x2F;catonmat.net&#x2F;unix-utilities-pipe-viewer" rel="nofollow">https:&#x2F;&#x2F;catonmat.net&#x2F;unix-utilities-pipe-viewer</a>
Drybonesover 2 years ago
Funny timing as I recently, as of yesterday, found out about pv when searching for a way to view the progress of a zfs send and receive<p>Another utility I found out about is “progress” available at least on debian systems. It can monitor stuff like cp and mv without actually being used in the command
Kukumberover 2 years ago
Can someone change the URL to https? <a href="https:&#x2F;&#x2F;www.ivarch.com&#x2F;programs&#x2F;pv.shtml" rel="nofollow">https:&#x2F;&#x2F;www.ivarch.com&#x2F;programs&#x2F;pv.shtml</a>
herpderperatorover 2 years ago
Can I just say, there&#x27;s something so nice about this webpage. It&#x27;s information-dense and well organised. I wish we had more of this today.
torgardover 2 years ago
There are countless times where I would have found this incredibly helpful. Just 10 minutes ago, I wanted this exact tool.<p>Thanks!
estover 2 years ago
pv was the tool when I discovered sometimes the VPS have only 10Gbps memory copy speed.
sigmonsaysover 2 years ago
i&#x27;ve consistently lost and found this tool over and over again for over 20 years
评论 #33267465 未加载
TT-392over 2 years ago
But... pipe-viewer was already a commandline youtube browser
评论 #33265546 未加载