Last Updated: February 25, 2016
·
819
· sheerun

Download file with CURL without repeating file name

Instead:

curl http://example.com/foo.txt -o foo.txt

Do:

curl -O http://example.com/foo.txt

Or if you want to support redirects and header-specified file names:

curl -JOL http://example.com/foo.txt