Sometimes I stumble in files I cannot download with wget. So maybe someone has a hint for me?

For example I want to download via the following link: https://exchange.nagios.org/components/com_mtree/attachment.php?link_id=2516&cf_id=24

So I type:

wget https://exchange.nagios.org/components/com_mtree/attachment.php?link_id=2516&cf_id=24

wget does create a file with the name attachment.php?link_id=2516&cf_id=24 and it's unfortunately empty.

I've also tested it with options like --trust-server-names, but without any success.


The & needs to be escaped, because it put the foreground task into the background.

So the following works:

wget https://exchange.nagios.org/components/com_mtree/attachment.php?link_id=2516\&cf_id=24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.