Downloading with wget

I don’t know if this is the right place, but I’m having trouble downloading a tar file with wget. I’m trying to get the latest file, but I don’t know how to use regex or grep to get this file:

But ultimatly whats the prefered methode to get a file without worriying about the version number.

Calibre for example (but a bad one) doesn’t have a release number…

Is curl better ?
If it helps, I am a Manjaro user :smiley:

It works for me:

❯ wget
--2021-06-10 12:58:57--
Loaded CA certificate '/etc/ssl/certs/ca-certificates.crt'
Resolving (
Connecting to (||:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 67378058 (64M) [application/gzip]
Saving to: ‘tmm_4.1.5.1_linux.tar.gz.1’

tmm_4.1.5.1_linux.tar.g 100%[==============================>]  64.26M  12.9MB/s    in 5.2s    

2021-06-10 12:59:03 (12.3 MB/s) - ‘tmm_4.1.5.1_linux.tar.gz.1’ saved [67378058/67378058]
1 Like

if I understand well you wish to make a get without knowing the url.
it is not possible to know the last version from a file url (or use ls with ftp) but it is sometimes possible to get a html page and extract url
solution is always different, for exemple

 curl -s '' | grep -io 'v4/.*linux.*tar.gz' | tail -n1
 f=$(curl -s '' | grep -io 'v4/.*linux.*tar.gz' | tail -n1)
 wget "$f"

yes but my request was more along the lines of what papajoke did.

In the end I used that :

wget`wget -qO- | grep 'linux.tar.gz' | grep -Po -m 1 "href='\K.*?(?=')"`

I wonder though if your methode is better...
1 Like