Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

I wanted to download some tuts on aircrack by wget and I failed:

wget -r 2\?id=tutorial\&DokuWiki=78e8249415a9ce232228ed8f9f02b9dd 
--2011-10-06 14:16:11--  http://2/
Resolving 2...
Connecting to 2||:80... failed: Invalid argument.
--2011-10-06 14:16:11--
Resolving, 2001:41d0:1:1b00:213:186:33:2
Connecting to||:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html] Invalid argument

Cannot write to `' (Invalid argument).

Do you know how to fix this problem ?

share|improve this question
I can't reproduce the problem, but you should remove the 2 after -r (that option doesn't take an argument). – Kusalananda Oct 6 '11 at 12:30

This is probably the filesystem you're downloading to not allowing a filename with "?" in it. Note that the error is "Cannot write".

You can use the --restrict-file-names=windows option to escape names for compatibility with FAT filesystems. (Note that the non-reversible additional %-encoding done by wget is not actually correct vs. web architecture, but you probably don't care.)

You could also use -O <filename> to specify a particular filename if you were downloading only one file.

share|improve this answer

The & also commonly causes problems. Try putting the whole url in quotes.

share|improve this answer

As suggested by pjc50, please put the URL within quotes when you have special characters in it. Therefore, you should try:

wget -r 2 ''

When you do not use quotes, the shell, on encountering a &, assumes you want to run the wget job in background.

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.