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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:


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 system and network administrators.

Cannot reproduce: what curl version on which system? – enzotib Aug 28 '11 at 16:34
up vote 8 down vote accepted


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

Your Answer


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.