How to use curl to download content from sourceforge

curl

Simply typing http://downloads.sourceforge.net/project/romfs/genromfs/0.5.2/genromfs-0.5.2.tar.gz works fine on a browser, but I'm trying to download from a CLI environment with limited utilities.

The following just returns an empty file:

curl http://downloads.sourceforge.net/project/romfs/genromfs/0.5.2/genromfs-0.5.2.tar.gz

How do I get genromfs-0.5.2.tar.gz from sourceforge using curl?

Best Answer

You can do

curl -L  http://downloads.sourceforge.net/project/romfs/genromfs/0.5.2/genromfs-0.5.2.tar.gz > genromfs.tar.gz

to download the file.

The -L tells curl to follow any redirects, which sourceforge normally does.

If wget is available, that would be far simpler.

Related Question