wget only retain filename when downloading, not entire web path

Viewed 23

I am downloading files from this webpage, http://thredds.northwestknowledge.net:8080/thredds/catalog/TERRACLIMATE_ALL/data/catalog.html. I only want to download files which contain tmin in the filename.

I am currently doing this:

 wget --trust-server-names -r -nd -A *tmin* --recursive --no-parent -e robots=off 'http://thredds.northwestknowledge.net:8080/thredds/catalog/TERRACLIMATE_ALL/data/catalog.html'

but this downloads the full pathway. For example this file http://thredds.northwestknowledge.net:8080/thredds/catalog/TERRACLIMATE_ALL/data/catalog.html?dataset=TERRACLIMATE_ALL_SCAN/data/TerraClimate_tmin_2021.nc

Would be downloaded as catalog.html?dataset=TERRACLIMATE_ALL_SCAN/data/TerraClimate_tmin_2021.nc

when I only want to download the name of the file which is TerraClimate_tmin_2021.nc

0 Answers
Related