Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I only display a progess bar with wget in vagrant provisioning?

I am using wget in bash script when I provision ubuntu machine with vagrant like

wget https://www.example.com/test.zip -O test.zip

As this file is big, the screen which I see with vagrant is like this:

==> default: 569600K .......... .....
==> default: ..... .......... .
==> default: ......... .......
==> default: ... 47% 1.18M 47m34s
==> default: 569650K .......... ...
==> default: ....... .........
==> default: . .......... .....
==> default: ..... 47% 75.4K 47m34s
==> default: 569700K .......... .
==> default: ........
==> default: . .......
==> default: ... .......... ...
==> default: ....... 47% 41.9M 47m34s
==> default: 569750K .........
==> default: . .......... .....
==> default: ....
==> default: .
==> default: ...
==> default: ....... .
==> default: ......... 47% 42.8M 47m34s
==> default: 569800K .......
==> default: ... .......... ...
==> default: ....... .
==> default: ........

This keeps coming every second and all important information is lost.

Is there any way I can see only a progress bar and no other junk information every second.

like image 743
user3214546 Avatar asked Jul 04 '15 08:07

user3214546


1 Answers

The best you could do - use --no-verbose (or -nv) option:

wget --no-verbose https://www.example.com/test.zip -O test.zip

This will turn off all unimportant output (progress bar) from wget.

Or use --progress=bar:force:

wget --progress=bar:force https://www.example.com/test.zip -O test.zip

This will make output look like this:

...
Python-3.5.0.tar.xz   7%[>                     ]   1013K   343KB/s             
Python-3.5.0.tar.xz  11%[=>                    ]   1,54M   346KB/s   eta 38s   
Python-3.5.0.tar.xz  14%[==>                   ]   1,99M   316KB/s   eta 38s   
Python-3.5.0.tar.xz  18%[===>                  ]   2,59M   306KB/s   eta 37s 
...
like image 184
Bunyk Avatar answered Sep 28 '22 05:09

Bunyk