Paweł Staniec
Paweł Staniec

Reputation: 3181

How to force wget to skip links leading to parent elements?

Let's say I've got:

http://svnserver/repoid/appname/language/module/

I'm trying to download everything below module node, unfortunately page contains links to both - items below and items above in hierarchy (much like bash ls -ltr output). So when I use wget with recursive download option I end up with complete website (svn repository) downloaded and not only the module I need.

Is there any trick to prevent wget from following links that point to parent elements?

Upvotes: 9

Views: 5311

Answers (2)

Oleg Mikheev
Oleg Mikheev

Reputation: 17444

From man wget:

-np

--no-parent

Do not ever ascend to the parent directory when retrieving recursively. This is a useful option, since it guarantees that only the files below a certain hierarchy will be downloaded.

Upvotes: 4

user330315
user330315

Reputation:

Sounds like you are looking for the --no-parent parameter.

From the output of wget --help

 -np, --no-parent                 don't ascend to the parent directory.

Upvotes: 16

Related Questions