Suppose the directory
http://www.example.com/content/media/images/vacation_photos
contains links to a number of sub-directories:
/sweden
/egypt
/canada
each of which contains a bunch of JPEGs, and I want to download them all to my local folder:
/home/jack/VacationPhotos
So that I end up with everything in directories
/home/jack/VacationPhotos/sweden
/home/jack/VacationPhotos/egypt
/home/jack/VacationPhotos/canada
the problem is, if I give wget that URL, apply the -r
(recursive) option and the -P /home/jack/VacationPhotos
option, it downloads everything to
/home/jack/VacationPhotos/content/media/images/vacation_photos/sweden
and so on, rather than the structure I wanted. Is it possible to get this kind of behavior in wget?
--cut-dirs 100
to remove almost all parent dirs, and this will not cut any subdirs. https://stackoverflow.com/questions/5043239/how-do-i-mirror-a-directory-with-wget-without-creating-parent-directories#comment58693987_5045370 – CoderGuy123 May 02 '20 at 15:05