wget -O for non-existing save path? wget -O for non-existing save path? linux linux

wget -O for non-existing save path?


Try curl

curl http://www.site.org/image.jpg --create-dirs -o /path/to/save/images.jpg


mkdir -p /path/i/want && wget -O /path/i/want/image.jpg http://www.com/image.jpg


To download a file with wget, into a new directory, use --directory-prefix without -O:

wget --directory-prefix=/new/directory/ http://www.example.com/old_image.jpg

Using -O new_file in conjunction with --directory-prefix, will not create the new directory structure, and will save the new file in the current directory. It may even fail with "No such file or directory" error, if you specify -O /new/directory/new_file