I'm trying to use pv
, but I want to hide the command I piped in's output while still be able to see pv's output. Using command &> /dev/null | pv
doesn't work (as in, pv doesn't receive any data). command
produces output on both standard output and standard error, and I don't want to see either.
I tried using a grep pipe (command &> /dev/null | pv | grep <=>
) but that now and then outputs things to the terminal.
Best Answer
man pv
says:The output you see comes from
pv
. The progress bar is on stderr, and the content you piped in is on stdout. You can redirect the output:and you will still get the progress bar output.
If the command produces its own text on stderr as well, you can redirect that explicitly to
/dev/null
, before passing on the output topv
: