You can use wget
's --no-parent
(-np
) and --level=depth
(-l
) options to control how much of the site will be mirrored by the -r
option. The --no-host-directories
(-nH
) and --no-directories
(-nd
) options will also prevent wget from duplicating the remote directory structure.
(Double hyphen precedes options when they are written in full, , while single hyphen precedes options when they are written in short form --no-parent is -np)
e.g. something like this:
wget -r -l 1 -nH -nd -np --ignore-case -A '*.pdf' https://www.in.tum.de/i07/lehre/ss22/theo/
By default, that will save the .pdf files in the current directory. You can use the -P
option to specify a different output dir.
wget
is very flexible and has a lot of options - so many that the man page can be overwhelming when you first read it, but it is definitely worth putting in some effort to read and experiment with.