How to show wget progress bar only?

前端 未结 9 915
情歌与酒
情歌与酒 2021-01-30 06:19

For example:

wget http://somesite.com/TheFile.jpeg

downloading: TheFile.tar.gz ...
--09:30:42--  http://somesite.com/TheFile.jpeg
                   


        
9条回答
  •  心在旅途
    2021-01-30 06:54

    The option --show-progress, as pointed out by others, is the best option, but it is available only since GNU wget 1.16, see Noteworthy changes in wget 1.16.

    To be safe, we can first check if --show-progress is supported:

    # set progress option accordingly
    wget --help | grep -q '\--show-progress' && \
      _PROGRESS_OPT="-q --show-progress" || _PROGRESS_OPT=""
    
    wget $_PROGRESS_OPT ...
    

    Maybe it's time to consider just using curl.

提交回复
热议问题