Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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

I'm trying mirror a website where it has page:


and contents:


This is what I'm using

wget -m -Dsite.com -e robots=off -r -q -R gif,png,jpg,jpeg,GIF,PNG,JPG,JPEG \
    -t 10 http://www.site.com &

When wget is run, it will create a HTML file with the name news.

I'm unable to download the contents because the file with the name news already exists (I'm running Ubuntu: directories cannot have same name as files)

Below is the message that appeared when running wget without -q

www.site.com/news/36-news: Not a directory
www.site.com/news/36-news/news-one: Not a directory

share|improve this question
up vote 4 down vote accepted

You might try --no-clobber. However, it seems to me like you'd probably be better suited with something a little more full-featured, such as httrack. Here's the manual for the command line options: http://www.httrack.com/html/fcguide.html

You can prefix all of your directories like this:

httrack "http://www.site.com/news" -O /tmp/site -N "my%p/%n.%t"

So the full command, similar to yours, could be something like:

httrack "http://www.site.com/news" -O /tmp/site -N "my%p/%n.%t" --retries=10 --ext-depth=0 --robots=0 +*.gif +*.png +*.jpg +*.jpeg +*.GIF +*.PNG +*.JPG +*.JPEG
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.