wget -x를 사용하여 폴더 구조를 다운로드할 수 있지만 도메인 디렉터리를 생성할 수는 없습니까?

wget -x를 사용하여 폴더 구조를 다운로드할 수 있지만 도메인 디렉터리를 생성할 수는 없습니까?

나는 현재 이 일을 하고 있습니다:

wget -i download.txt -x

루트 디렉토리를 생성합니다 example.org/. 내가 원하는 것은 하위 디렉터리를 만드는 것뿐입니다.

wget이 내가 원하는 것을 강제로 수행하도록 하는 방법이 있나요?

답변1

매뉴얼 페이지에 따르면 이 매개변수는 -nH요구 사항을 충족해야 합니다.

   Directory Options
   -nd
   --no-directories
       Do not create a hierarchy of directories when retrieving recursively.  With this option turned on, all
       files will get saved to the current directory, without clobbering (if a name shows up more than once,
       the filenames will get extensions .n).

   -x
   --force-directories
       The opposite of -nd---create a hierarchy of directories, even if one would not have been created
       otherwise.  E.g. wget -x http://fly.srk.fer.hr/robots.txt will save the downloaded file to
       fly.srk.fer.hr/robots.txt.

   -nH
   --no-host-directories
       Disable generation of host-prefixed directories.  By default, invoking Wget with -r
       http://fly.srk.fer.hr/ will create a structure of directories beginning with fly.srk.fer.hr/.  This
       option disables such behavior.

-i귀하의 예에 사용된 매개변수가 실제로 필요한지 잘 모르겠습니다 .

내 관점에서 설명하는 내용을 달성하려면 다음을 실행하는 것으로 충분합니다.

wget -xnH download.txt

관련 정보