1
vote
4answers
703 views

Write output of wget or curl to a custom filename based on the url

For example I have a link http://www.abc.com/123/def/ghi/jkl.mno. I want to download it using wget or curl and get the name of output file as def_ghi_jkl.mno, where the part def_ghi is taken from the ...
2
votes
1answer
293 views

Given a mime-type get the corresponding file extension

I want to download I file using curl to a temporary directory with the appropriate extension. Currently I do something like this: tmp="$(mktemp -t 'curl')" curl -o "$tmp" ...
2
votes
1answer
531 views

Predict filename before downloading from a URL, in shell script

I have a shell script that downloads files from a list using wget, and resumes automatically if there is any non-critical error (because of unstable WIFI during storms). The problem is, I want to ...
1
vote
1answer
3k views

How can I specify that curl (via command line) overwrites a file if it already exists?

I'm using curl in this syntax: curl -o myfile.jpg http://mysite.com/myfile.jpg If I run this command twice, I get two files: myfile.jpg myfile-1.jpg How can I tell CURL that I want it to ...