![wget -x를 사용하여 폴더 구조를 다운로드할 수 있지만 도메인 디렉터리를 생성할 수는 없습니까?](https://linux55.com/image/74730/wget%20-x%EB%A5%BC%20%EC%82%AC%EC%9A%A9%ED%95%98%EC%97%AC%20%ED%8F%B4%EB%8D%94%20%EA%B5%AC%EC%A1%B0%EB%A5%BC%20%EB%8B%A4%EC%9A%B4%EB%A1%9C%EB%93%9C%ED%95%A0%20%EC%88%98%20%EC%9E%88%EC%A7%80%EB%A7%8C%20%EB%8F%84%EB%A9%94%EC%9D%B8%20%EB%94%94%EB%A0%89%ED%84%B0%EB%A6%AC%EB%A5%BC%20%EC%83%9D%EC%84%B1%ED%95%A0%20%EC%88%98%EB%8A%94%20%EC%97%86%EC%8A%B5%EB%8B%88%EA%B9%8C%3F.png)
나는 현재 이 일을 하고 있습니다:
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