This question explains how to do it with curl
. The accepted answer also points out that
If wget is available, that would be far simpler.
I looked through man wget
but the got lost in there, and didn't find an option to follow redirects.
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communityThis question explains how to do it with curl
. The accepted answer also points out that
If wget is available, that would be far simpler.
I looked through man wget
but the got lost in there, and didn't find an option to follow redirects.
wget follows redirects automatically. Just give the URL as an argument
wget 'http://downloads.sourceforge.net/project/romfs/genromfs/0.5.2/genromfs-0.5.2.tar.gz'
&
's in them as well (pre redirect)
wget
with the SourceForge download URL, the wget
output shows the Location:
header containing the "real" URL to which the HTTP GET operation is redirected. Copy this URL for subsequent use with HTTP GET agents that cannot follow redirects.
Dec 28, 2015 at 16:38
download?use_mirror=vorboss.html
file. What is the solution now?
Nov 1, 2016 at 10:20
wget 'http://downloads.sourceforge.net/project/romfs/genromfs/0.5.2/genromfs-0.5.2.tar.gz'
Start the download in chrome browser. When it starts cancel it and go to downloads page. You can see the url for the download. Copy it and use it with wget.
Click the link, you'll get redirected, and you'll see something like "Redirecting... if you are not automatically redirected, click the direct link.
Copy that [direct] link's location, paste it in the command-line like this
wget "http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz"
That's it! It worked for me.
Edit: You should omit everything after the '?' character in the url, or else the filename will also have this part.
man wget
?