wget으로 여러파일을 한번에 다운 받으려면?

foruses의 이미지

wget으로 여러개의 파일을 *를 써서 한꺼번에 다운받으려고 하는데 에러가 발생합니다.

wget http://aaa.bb.cc.kr/data/*.nc
wget: No match

해결 방법 아시는 분?

Prentice의 이미지

wget은 filename globbing을 FTP에서만 지원합니다. --recursive 옵션을 주시면서 -A와 -R로 확장자를 제한하시면 어떨까요.

자세한 것은 man wget 또는 info wget 해보시면 나옵니다.

foruses의 이미지

디렉토리와 index.html파일들은 받아지는데, 정작 원하는 파일은 안 들어옵니다.

>more list.txt
nc

>wget --recursive -A list.txt http://aaa.bb.cc.dd/................../data

디렉토리가 7개 이상되는데, 갯수의 제한이 있는건가요.

웹으로부터 많은 수의 파일을 한번에 받을 수 있게 하는 다른 리눅스 명령어나 쓸만한 프로그램은 없는지요.

aero의 이미지

wget에서 ftp로 부터 받을때는
-g, --glob-on/off 같은 file globbing을 켜는 옵션이 있는데
HTTP쪽으로는 없는것 같네요
받고 싶은 file url 리스트를 따로 만들어서
-i, --input-file=FILE 옵션을 사용하시든지
그냥
wget 파일URL1 파일URL2 ....
이런식으로 받으셔야 할겁니다.

답변쓰고 보니 위에 글이 올라왔는데 위처럼 하면 되겠네요. :)

astronux의 이미지

예를 들어, http://www.abc.com/mydir/밑에 있는 디렉토리 및 파일들을 모두 받고 싶으시면,
wget -rnd URL
예) wget -rnd http://www.abc.com/mydir/
하시면, 내 컴퓨터에 mydir이라는 디렉토리가 생기고, 여기에 똑같은 디렉토리 구조로 받아집니다.

Astronomy+Linux

bff38auxo의 이미지

현재 디렉토리에 다 받아지네요.. 디렉토리는 생성되지 않는 듯 합니다.

사용한 파일은
GNU Wget 1.10.2 (Red Hat Modified)
라고 나옵니다.

옵션을 보니

2.6 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).

라고 되어있네요. -r 은 recursive옵션일테고..

Prentice의 이미지

제가 생각이 짧았습니다. http://aaa.bb.cc.kr/data/ 여기에 접속했을 때 서빙되는 HTML 문서가 있어야만, 또 문서에 원하는 파일들이 모두 링크돼있어야만 가능할 것 같습니다.

wget --recursive http://blacksun.ivyro.net/wget/ -R.h
wget --recursive http://blacksun.ivyro.net/wget/ -A.c

이렇게라면 가능합니다.

익명 사용자의 이미지

wget -i filelist.txt

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.