Skip to content
Advertisement

wget -O for non-existing save path?

I can’t wget while there is no path already to save. I mean, wget doens’t work for the non-existing save paths. For e.g:

wget -O /path/to/image/new_image.jpg http://www.example.com/old_image.jpg

If /path/to/image/ is not previously existed, it always returns:

No such file or directory

How can i make it work to automatically create the path and save?

Advertisement

Answer

Try curl

curl http://www.site.org/image.jpg --create-dirs -o /path/to/save/images.jpg
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement