Skip to main content
2 of 4
edited tags
Gilles 'SO- stop being evil'
  • 865.3k
  • 205
  • 1.8k
  • 2.3k

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

cwd
  • 47k
  • 73
  • 155
  • 172