Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

sorry,.. I'm noob in Ubuntu ... and I'm trying to make a robots for downloading file..

i can download the zip file via web browser's address bar like this

but, when i try to use wget, the file never been downloaded...

this is how i use wget :

$ wget -H
$ wget -H -k
$ wget -H -m
$ wget -H -m -k

all wget just download the php file.. when i open it, it's just
<font color=red>invalid url</font>

does it because of redirect ? or cookie ? when i clear all cookie in mozilla, and download again.. it still wokrs..

or session ? is never use login user to download

share|improve this question
up vote 3 down vote accepted

You have to use apostrophes or double quotes around the URL, because it contains the special character &.

share|improve this answer
thanks.... i dont know that & is spesial char – Warung Nasi 49 Jun 7 '11 at 7:16

You have to use single(') or double quotes(") in URL, so the link should look like this:

$ wget ""
share|improve this answer
sorry,.. i accept @elmicha answer.. cause he answer first.. but thanks,... i vot up your answer.. – Warung Nasi 49 Jun 7 '11 at 7:17

Really awesome solution....! It works for me perfectly.


$command = "wget 'URL WITH QUERY STRING'";

exec("$command >/dev/null &");
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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