Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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 overwrite the file if it exists?

share|improve this question

migrated from serverfault.com Aug 28 '11 at 16:23

This question came from our site for professional system and network administrators.

3  
Cannot reproduce: what curl version on which system? –  enzotib Aug 28 '11 at 16:34

1 Answer 1

up vote 8 down vote accepted

Use:

curl http://mysite.com/myfile.jpg > myfile.jpg
share|improve this answer
1  
And beforehand, make sure you do not have the noclobber option enabled (set +o noclobber). –  rozcietrzewiacz Aug 28 '11 at 17:19

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.