2

I use this command to download the entire wikipedia content of main page :

wget -p -k https://en.wikipedia.org/wiki/Main_Page

But I receive an error when try to combine it with -O in order to rename the downloaded parent dir :

wget -p -k https://en.wikipedia.org/wiki/Main_Page -O mydir

Cannot specify both -k or --convert-file-only and -O if multiple URLs are given, or in combination
with -p or -r. See the manual for details.

How to download the URL entirely and name the downloaded parent dir ?

2 Answers 2

1

Either

mkdir mydir && chdir mydir && \
    wget -p -k https://en.wikipedia.org/wiki/Main_Page 

or

wget -p -k https://en.wikipedia.org/wiki/Main_Page
mv -Tf en.wikipedia.org mydir

Depending on where exactly you want it

1

Use the -O option without combination with -k :

wget https://en.wikipedia.org/wiki/Main_Page -O mydir

Edit

Use -P option and specify the directory:

 wget -P /path/to/mydir -k https://en.wikipedia.org/wiki/Main_Page/

Example

wget -P mydir -k https://en.wikipedia.org/wiki/Main_Page/
1
  • 1
    thanks but that does not grab all content of the page.
    – blue-sky
    Sep 3, 2016 at 15:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .