Using pv
to pipe the file to tar
.
-
Firstly, you’ll need to install
pv
, which on macOS can be done with:brew install pv
On Debian or Ubuntu, it can be done with:
apt install pv
(Thanks @hyperbola!). -
Pipe the compressed file with
pv
to thetar
command:pv mysql.tar.gz | tar -xz
Here’s the sample output of this command:
For those curious, this works by pv
knowing the total file size of the file you pass it and how much of it has been “piped” to the tar
command. It uses those two things to determine the current progress, the average speed, and the estimated completion time. Neat!