For example:
wget http://somesite.com/TheFile.jpeg downloading: TheFile.tar.gz ... --09:30:42-- http://somesite.com/TheFile.jpeg => `/home/me/Downloads/TheFile.jpeg' Resolving somesite.co... xxx.xxx.xxx.xxx. Connecting to somesite.co|xxx.xxx.xxx.xxx|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 1,614,820 (1.5M) [image/jpeg] 25% [======> ] 614,424 173.62K/s ETA 00:14 How can I get it to look like the following? downloading: TheFile.jpeg ... 25% [======> ] 614,424 173.62K/s ETA 00:14
I know curl can do that. However, I need to get wget to do that job.
You can use -nv or --no-verbose to make wget less verbose, but it won't show download progress in that case. Show activity on this post. --show-progress will override the "quiet" flag.
The main difference between them is that curl will show the output in the console. On the other hand, wget will download it into a file.
Wget is a networking command-line tool that lets you download files and interact with REST APIs. It supports the HTTP , HTTPS , FTP , and FTPS internet protocols. Wget can deal with unstable and slow network connections. In the event of a download failure, Wget keeps trying until the entire file has been retrieved.
Wget is the non-interactive network downloader which is used to download files from the server even when the user has not logged on to the system and it can work in the background without hindering the current process. GNU wget is a free utility for non-interactive download of files from the Web.
Use:
wget http://somesite.com/TheFile.jpeg -q --show-progress
-q
: Turn off wget
's output
--show-progress
: Force wget
to display the progress bar no matter what its verbosity level is set to
You can use the following filter:
progressfilt () { local flag=false c count cr=$'\r' nl=$'\n' while IFS='' read -d '' -rn 1 c do if $flag then printf '%s' "$c" else if [[ $c != $cr && $c != $nl ]] then count=0 else ((count++)) if ((count > 1)) then flag=true fi fi fi done }
$ wget --progress=bar:force http://somesite.com/TheFile.jpeg 2>&1 | progressfilt 100%[======================================>] 15,790 48.8K/s in 0.3s 2011-01-13 22:09:59 (48.8 KB/s) - 'TheFile.jpeg' saved [15790/15790]
This function depends on a sequence of 0x0d0x0a0x0d0x0a0x0d
being sent right before the progress bar is started. This behavior may be implementation dependent.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With