Search code examples
wget

Wget: Filenames without the query string


I want to download a list of webpages from a file. How can I stop Wget appending the query strings on to the saved files?

wget http://www.example.com/index.html?querystring

I need this to be downloaded as index.html, not index.html?querystring


Solution

  • There is the -O option:

    wget -O file.html http://www.example.com/index.html?querystring
    

    so you can alter a little bit your script to pass to the -O argument the right file name.