0

I am trying download files and directories inside a site at say https://www.example.com/dir1/dir2/dir3/dir4/ . What I want is that I get all the contents at this url, as in files and directories, exactly in the same way and store them in a directory named "dir" on my machine. The command I used is wget -r --no-parent -P "dir" https://www.example.com/dir1/dir2/dir3/dir4/ . But what this does is create folders in my directory as dir/dir1/dir2/dir3/dir4/..all the contents here... What I want is dir/.. All the contents here... How can I achieve that?

1 Answer 1

1

From man wget

--cut-dirs=number

Ignore number directory components. This is useful for getting a fine-grained control over the directory where recursive retrieval will be saved.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.