0

I have added --directory-prefix=~/Downloads in ~/.wgetrc

Looking through the manual for wget I am having trouble understanding how to pass a local subdirectory on the command line that would amend the directory prefix path that is set in .wgetrc.

I presume I can bypass by declaring a new --directory-prefix in the call, but I am asking can the call be amended without having to.

pseudocode

wget ./subdirectory https://www.website.com

Presuming that "." would represent the --directory-prefix set in .wgetrc

1 Answer 1

1

In your case

wget $(grep directory-prefix ~/.wgetrc)/subdirectory https://www.example.com

would work (it obviously will fail if directory-prefix isn't set).

PS: Not sure it is all that useful, though :-)

1
  • Not a terrible option - I suppose I could build a function. I was looking for a method built into wget itself and thought I may have overlooked some flag or option... I guess when they refer to "subdirectories" they aren't talking about local directories but the directories created when downloading a website.
    – John
    Commented Aug 13, 2022 at 23:45

You must log in to answer this question.

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