How to download streamed files with wget?

Posted on

Problem :

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.

Solution :

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

Leave a Reply

Your email address will not be published. Required fields are marked *