I\'m on mac OS X and can\'t figure out how to download a file from a URL via the command line. It\'s from a static page so I thought copying the download link and then using
There are several options to make curl output to a file
# saves it to myfile.txt
curl http://www.example.com/data.txt -o myfile.txt -L
# The #1 will get substituted with the url, so the filename contains the url
curl http://www.example.com/data.txt -o "file_#1.txt" -L
# saves to data.txt, the filename extracted from the URL
curl http://www.example.com/data.txt -O -L
# saves to filename determined by the Content-Disposition header sent by the server.
curl http://www.example.com/data.txt -O -J -L
# -O Write output to a local file named like the remote file we get
# -o Write output to instead of stdout (variable replacement performed on )
# -J Use the Content-Disposition filename instead of extracting filename from URL
# -L Follow redirects