2

I wonder if there is a way to unzip a file via "unzip" in the shell while having only the current file outputted instead of total silence "-q" or a ever growing list that slows down the process esp. via ssh and fills your console window.

Or is there at least another way to see progress without outputting every single path?

1

2 Answers 2

3

You could use pv in line mode:

unzip archive.zip | pv -l >/dev/null

Gives you an updating progress line looking like this:

 203 0:00:00 [3.93k/s] [ <=>                                                   ]
1

You can use pv with tools like tar, but it will not work with unzip. If you try it, it will not show its progress.

You can use a trick like the following to show the progress which actually prints a dot for every line of output (every extracted file). This will be less verbose than showing a line for every file and still shows how unzip is progressing.

unzip file.zip | awk 'BEGIN { ORS = " " } { print "." }'
1
  • pv can count lines of unzip output, which may act loosely like a progress indicator. Not a perfect solution, of course, but can work in some cases. Jul 4, 2017 at 12:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .