Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 04-23-2016, 12:45 AM   #1
Registered: Feb 2011
Location: Osaka, Japan
Distribution: Gentoo, Opensuse
Posts: 264

Rep: Reputation: 5
Use wget to download newest version of file


I made a script to automate a linux install with all packages and configurations for a security server at work.

Everything works well, but I would like to tweak it to download the newest version of a proprietary package.

The problem I'm having is that the package provider makes minor updates frequently, and the revision number of the package changes. The way I am currently using "wget" is very simple, and it doesn't download unless I provide the complete name of the package:

What would you recommend to download the newest revision when the script runs? Can you somehow use a wildcard in wget, then run a find on everything that was downloaded?(wildcard didn't work when I tried it)
Old 04-23-2016, 01:37 AM   #2
Registered: Apr 2016
Location: Borås, Sweden
Distribution: CentOS
Posts: 54

Rep: Reputation: 18
If you can get this via FTP, wget supports wildcards. Not via http, however.
Old 04-23-2016, 12:38 PM   #3
LQ Addict
Registered: Dec 2013
Posts: 5,802

Rep: Reputation: 1381Reputation: 1381Reputation: 1381Reputation: 1381Reputation: 1381Reputation: 1381Reputation: 1381Reputation: 1381Reputation: 1381Reputation: 1381
  • look at wget documentation. maybe it's possible to just go for the newest file?
  • consider using other download tool like curl?
  • get the name of the newest version by parsing some web content, then tell wget to download that. can be automated in a script.
i think i like the last option best
1 members found this post helpful.
Old 09-04-2016, 01:29 PM   #4
Registered: Feb 2011
Location: Osaka, Japan
Distribution: Gentoo, Opensuse
Posts: 264

Original Poster
Rep: Reputation: 5
a little late for thanks, but thank you!

Curl does pretty much what I want, and it can follow re-directs.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Download the newest file seprob Linux - Networking 7 12-09-2014 11:18 AM
wget: download if file size does not match any file in folder Si14 Linux - Software 1 04-21-2013 06:00 AM
download file via wget ust Linux - Newbie 18 03-08-2011 03:44 AM
Should I download newest Linux kernel 2.6 version? trien27 Linux - Kernel 2 06-06-2009 04:47 PM
wget any version of a file? shishimo Linux - General 1 07-08-2004 01:37 PM

All times are GMT -5. The time now is 12:44 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration