WGET(1) WGET(1) - . wget []... [_]... . HTTP HTTPS FTP HTTP. . . . HTML XHTML CSS . " ". (/robots.txt). . . . getopt . . . : wget -r --tries=10 http://fly.srk.fer.hr/ -o log . -o log -olog. : wget -drc <_> : wget -d -r -c <_> --. -x log: wget -o log -- -x . .wgetrc. .wgetrc "exclude_directories" /cgi-bin /~nobody /~somebody. .wgetrc. wget -X "" -X /~nobody,/~somebody (""). --follow-ftp FTP HTML --no-glob (globbing) FTP. ( --no). . . --follow-ftp FTP HTML. --no- --no-. - . "follow_ftp = on" .wgetrc FTP --no-follow-ftp . -V --version . -h --help . -b --background . -o wget-log. -e --execute .wgetrc. .wgetrc . wgetrc -e. -o _ --output-file=_ _. . -a _ --append-output=_ _. -o _ . _ . -d --debug . -d. --- -d. -q --quiet . -v --verbose . . -nv --no-verbose ( -q ) . --report-speed= . bits. -i --input-file= . - . ( ./- -.) . . --force-html . --force-html html. "" --base= . html Content-Type text/html. (base href) . "O_NONBLOCK" . (EOF) . . . --input-metalink= (Metalink) . 3 4 . --keep-badhash (hash) . .badhash . --metalink-over-http HTTP HEAD GET . . HTTP . / Content-Type: application/metalink4+xml. --metalink-index= metaurl application/metalink4+xml. 1 "application/metalink4+xml" . 0 inf . metaurl --metalink-over-http . --preferred-location . . --xattr HTTP Referer . . -F --force-html HTML. HTML "" HTML --base. -B --base= HTML -i/--input-file ( --force-html HTML). "BASE" HTML "href". http://foo/bar/a.html ../baz/b.html http://foo/baz/b.html. --config= () . --no-config . --config --no-config --no-config. --rejected-log=_ _ . . --bind-address= TCP/IP . IP. IP . --bind-dns-address= [ libcares ] DNS. /etc/resolv.conf --dns-servers . IPv4 IPv6. libcares . --dns-servers= [ libcares ] /etc/resolv.conf. IPv4 IPv6 . libcares . -t --tries= . 0 inf . 20 " " " " (404) . -O --output-document= . - . ( ./- -.) -O " " : wget -O file http://foo wget -O - http://foo > file . -N ( ) -O: . . -r -p -O : : . 1.11 ( ) 1.11.2 . -nc . -k -k -k . -nc --no-clobber -nc. . . -N -nc -r -p .1. .2 . ( -nd -r -p .) -nc . ""no-clobber"" - ( ) . -r -p -N -nd -nc . -nc . -N -r -p . -nc -N. -O/--output-document . -nc .html .htm . --backups=_ () .1 (_1 VMS) . .2 .3 _ ( ). --no-netrc .netrc. .netrc . -c --continue . . : wget -c ftp://sunsite.doc.ic.ac.uk/ls-lR.Z ls-lR.Z . . . -c . -c ls-lR.Z.1 ls-lR.Z . -c Wget . 1.7 Wget -c Wget . ( )--- "" . -c "(length(remote) - length(local))" . --- wget -c . . Wget . -c -r " ". -c HTTP " " . "" . -c FTP HTTP "Range". --start-pos=OFFSET OFFSET ( ). `k' `m' . --start-pos --continue. --start-pos --continue wget --continue . --start-pos . -c . --progress=type . "dot" () "bar" (). "bar" . ASCII ( "") . (TTY) "dot" . --progress=dot . . (type) . . (:) : --progress=type:parameter1:parameter2. (style) dot:style. . "default" 1K 50 . "binary" ""--- 8K 16 48 ( 384K). "mega" --- 64K 48 ( 3M). "mega" "giga"--- 1M 32 ( 32M). --progress=bar force noscroll. "dot" --progress=bar Wget . "bar" "force" --progress=bar:force. bar . --progress=bar:force . "noscroll" Wget . "progress" .wgetrc. . --progress=bar:force:noscroll. --show-progress wget . wget . wget --no-verbose --quiet. wget . wget . stderr --output-file. -N --timestamping . --no-if-modified-since If-Modified-Since -N. HEAD . -N. --no-use-server-timestamps . . --timestamping wget . --no-use-server-timestamps. -S --server-response HTTP FTP. --spider Wget . Wget : wget --spider --force-html -i bookmarks.html Wget . -T seconds --timeout=seconds seconds . --dns-timeout --connect-timeout --read-timeout . Wget . . 900 . 0 . . . 0.1 ( ) . . --dns-timeout=seconds (DNS) seconds . . DNS . --connect-timeout=seconds seconds . TCP . . --read-timeout=seconds () seconds . "" : . . . 900 . --limit-rate=amount amount . k m. --limit-rate=20k 20KB/s. Wget . --limit-rate=2.5k . Wget . TCP . . -w seconds --wait=seconds . . "m" "h" "d". Wget . "--random-wait" . --waitretry=seconds Wget . Wget (seconds) . Wget 10 . --random-wait Wget . 0.5 1.5 * wait wait --wait Wget . 2001 . C DHCP. --random-wait . --no-proxy *_proxy . -Q quota --quota=quota . () ( k) ( m). . wget -Q10k https://example.com/ls-lR.gz ls-lR.gz. URL . . wget -Q2m -i sites --- . 0 inf . --no-dns-cache DNS . Wget IP DNS DNS ( ) . Wget DNS . Wget. Wget DNS ( "gethostbyname" "getaddrinfo") . NSCD. . --restrict-file-names=modes URL . %HH HH . . Wget . ASCII. (modes) . unix windows nocontrol ascii lowercase uppercase. unix windows ( ) lowercase uppercase. . "unix" Wget / 0--31 128--159. . "windows" Wget \ | / : ? " * < > 0--31 128--159. Wget + : @ ? . URL www.xemacs.org:4300/search.pl?input=blah www.xemacs.org+4300/search.pl@input=blah . . nocontrol . URL UTF-8 UTF-8 ( UTF-8 Wget ""). ascii ASCII ( 127) . . -4 --inet4-only -6 --inet6-only IPv4 IPv6. --inet4-only -4 Wget IPv4 AAAA DNS IPv6 URL. --inet6-only -6 Wget IPv6 A IPv4. . Wget IPv6 DNS . DNS IPv4 IPv6 Wget . ( "--prefer-family" .) IPv4 IPv6 . --inet6-only --inet4-only . Wget IPv6. --prefer-family=none/IPv4/IPv6 . DNS . IPv6 IPv4 IPv4. www.kame.net 2001:200:0:8002:203:47ff:fea5:3085 203.178.141.194. "IPv4" IPv4 "IPv6" IPv6 "none" DNS . -4 -6 . --- . IPv4 IPv6 . --retry-connrefused " " . Wget URL . . --user=user --password=password user password FTP HTTP. --ftp-user --ftp-password FTP --http-user --http-password HTTP. --ask-password . --password . --use-askpass=command . WGET_ASKPASS. WGET_ASKPASS SSH_ASKPASS. use-askpass .wgetrc. . --no-iri (IRI). --iri . IRI . IRI "iri" .wgetrc. . --local-encoding=encoding Wget encoding . Wget URL UTF-8 IRI. Wget nl_langinfo() "CHARSET" . ASCII. "local_encoding" .wgetrc. . --remote-encoding=encoding Wget encoding . Wget (URIs) UTF-8 . IRI ASCII. HTTP "Content-Type" HTTP HTML "Content-Type http-equiv". "remoteencoding" .wgetrc. . --unlink Wget (unlink) . . -nd --no-directories . ( .n). -x --force-directories -nd--- . wget -x http://fly.srk.fer.hr/robots.txt fly.srk.fer.hr/robots.txt. -nH --no-host-directories . Wget -r http://fly.srk.fer.hr/ fly.srk.fer.hr/. . --protocol-directories . wget -r http://host http/host/... host/.... --cut-dirs=number number . . ftp://ftp.xemacs.org/pub/xemacs/. -r ftp.xemacs.org/pub/xemacs/. -nH ftp.xemacs.org/ pub/xemacs. --cut-dirs Wget "" number . --cut-dirs. -> ftp.xemacs.org/pub/xemacs/ -nH -> pub/xemacs/ -nH --cut-dirs=1 -> xemacs/ -nH --cut-dirs=2 -> . --cut-dirs=1 -> ftp.xemacs.org/xemacs/ ... -nd -P. -nd --cut-dirs --- -nH --cut-dirs=1 beta/ xemacs/beta . -P --directory-prefix=prefix prefix. . . ( ). HTTP --default-page=name name ( URL ) index.html. -E --adjust-extension application/xhtml+xml text/html URL \.[Hh][Tt][Mm][Ll]? .html . .asp Apache . CGI. URL http://site.com/article.cgi?25 article.cgi?25.html. Wget X.html URL X ( URL text/html application/xhtml+xml). 1.12 Wget text/css .css --html-extension . . 1.19.2 Wget "Content-Encoding" br compress deflate gzip .br .Z .zlib .gz . Wget. --http-user=user --http-password=password user password HTTP. Wget "basic" ( ) "digest" "NTLM" . URL . "ps". --use-askpass .wgetrc .netrc "chmod". --- Wget . --no-http-keep-alive "keep-alive" HTTP. Wget TCP. . (keep-alive) . --no-cache . Wget (Cache-Control: no-cache Pragma: no-cache) . . . --no-cookies (). . "Set-Cookie" . . . --load-cookies file file HTTP. file cookies.txt Netscape. . HTTP . . Wget . --load-cookies--- Wget cookies.txt . : "Netscape 4.x." ~/.netscape/cookies.txt. "Mozilla and Netscape 6.x." Mozilla cookies.txt ~/.mozilla . ~/.mozilla/default/some-weird-string/cookies.txt. "Internet Explorer." Wget (File) (Import and Export) (Export Cookies). Internet Explorer 5 . "Other browsers." --load-cookies Netscape Wget. --load-cookies . " " . Wget "": wget --no-cookies --header "Cookie: =" --save-cookies file file . ( " ") --keep-session-cookies. --keep-session-cookies --save-cookies . . . Wget . Wget 0. --load-cookies Wget . --save-cookies --keep-session-cookies . --ignore-length HTTP ( CGI ) "Content-Length" Wget . Wget ( ) . Wget "Content-Length"--- . --header=header-line header-line HTTP. . --header . wget --header='Accept-Charset: iso-8859-2' \ --header='Accept-Language: hr' \ http://fly.srk.fer.hr/ . Wget 1.10 . Wget localhost foo.bar "Host": wget --header="Host: foo.bar" http://localhost/ Wget 1.10 --header . --compression=type . auto gzip none. auto gzip Wget gzip. "Content-Encoding" . none wget . . . "bug-wget@gnu.org". --max-redirect=number . 20 . ( ) . --proxy-user=user --proxy-password=password user password . Wget "basic". --http-password . --referer=url `Referer: url' HTTP. (Referer) . --save-headers HTTP . -U agent-string --user-agent=agent-string agent-string HTTP. HTTP "User-Agent". . Wget Wget/version version Wget. "User-Agent". () Netscape Microsoft Internet Explorer. "User-Agent" Wget. . --user-agent="" Wget "User-Agent" HTTP. --post-data=string --post-file=file POST HTTP . --post-data string --post-file file. . "key1=value1&key2=value2" . --post-file : "key=value" ( ) . Wget "multipart/form-data" POST "application/x-www-form-urlencoded". --post-data --post-file. wget "key1=value1&key2=value2" . Wget . POST HTML. POST --post-file Wget POST . POST. Wget POST . "--post-file" FIFO /dev/stdin. HTTP/1.0. HTTP/1.1 (chunked) HTTP/1.1. -- . : 1.15 Wget POST . 301 ( ) 302 ( ) 307 ( ) Wget RFC2616 POST. 303 ( ). POST : # . . wget --save-cookies cookies.txt \ --post-data 'user=foo&password=bar' \ http://example.com/auth.php # . wget --load-cookies cookies.txt \ -p http://example.com/interesting/article.php --save-cookies ( ) cookies.txt . --keep-session-cookies --save-cookies . --method=HTTP-Method RESTful Wget HTTP --header=Header-Line. Wget --method HTTP . --body-data=Data-String --body-file=Data-File --method. --body-data string --body-file file. . --body-file . Wget "multipart/form-data" "application/x-www-form-urlencoded". wget --body-file . Wget (BODY) --body-file . --post-file . --body-data --body-file. Wget Wget GET . 307 ( ) . "POST" --post-data. --content-disposition (on) ( ) "Content-Disposition". "HEAD" . CGI "Content-Disposition" . --metalink-over-http --trust-server-names Content-Type: application/metalink4+xml "Content-Disposition" . --content-on-error (on) wget http . --trust-server-names URL . URL . URL URL . --auth-no-challenge Wget HTTP ( ) Wget 1.10.2 . HTTP . --retry-on-host-error " " . --retry-on-http-error=[,,...] HTTP . HTTP 3 . Wget . 503 ( ) 429 ( ). Wget. . . HTTPS (SSL/TLS) HTTP (HTTPS) Wget SSL . GnuTLS. Wget HSTS ( HTTP). Wget SSL . --secure-protocol= . auto SSLv2 SSLv3 TLSv1 TLSv1_1 TLSv1_2 TLSv1_3 PFS. auto SSL TLSv1. . SSLv2 SSLv3 TLSv1 TLSv1_1 TLSv1_2 TLSv1_3 . SSL SSL . . PFS " ". PFS SSL. . ( MD4) TLS. PFS RSA. --https-only HTTPS . --ciphers . SSL/TLS ( GnuTLS ' '). SSL/TLS (OpenSSL GnuTLS) . Wget . OpenSSL GnuTLS . --no-check-certificate . URL . Wget 1.10 SSL . Wget . " " . " " " " . . . / . --check-certificate=quiet wget . --certificate= . . . --certificate-type= . PEM ( ) DER ASN1. --private-key= . . --private-key-type= . PEM () DER. --ca-certificate= ("CA") . PEM. Wget CA OpenSSL. --ca-directory= CA PEM. CA . "c_rehash" OpenSSL. --ca-directory --ca-certificate Wget . Wget CA OpenSSL. --crl-file= (CRL) . . --pinnedpubkey=/ wget ( ) . PEM DER sha256 base64 "sha256//" ";" TLS SSL . ( ) wget . --random-file= [OpenSSL LibreSSL ] /dev/urandom. SSL . EGD ( --egd-file ) . Wget $RANDFILE $HOME/.rnd. "Could not seed OpenSSL PRNG; disabling SSL." . --egd-file= [OpenSSL ] EGD. EGD . SSL . OpenSSL "RAND_FILE". OpenSSL EGD . ( ) EGD . EGD /dev/urandom. --no-hsts Wget HSTS ( HTTP RFC 6797). --no-hsts Wget HSTS. Wget "Strict-Transport-Security" HSTS . --hsts-file= Wget HSTS ~/.wget-hsts. --hsts-file . Wget HSTS. HSTS Wget. Wget . HSTS Wget . HSTS ( "Strict-Transport-Security" HSTS ). Wget ("#"). HSTS . HSTS : "<_> SP [<>] SP <__> SP <_> SP <_>" hostname port HSTS . port . HSTS ( ). port HSTS . / . Wget ( testenv/) HSTS Wget . HSTS RFC 6797 ( " HSTS "). port . . include_subdomains 1 0 HSTS . created max-age ( Wget) HSTS 'max-age' HSTS created. HSTS . HSTS --hsts-file Wget HSTS . Wget HSTS . Wget . HSTS . HSTS ( "Strict-Transport-Security") . (~/.wget-hsts) : HSTS. Wget HSTS. HSTS Wget . HSTS / . 14 " " RFC 6797 14.9 " HSTS". --warc-file= WARC . --warc-header= warcinfo. --warc-max-size= WARC . --warc-cdx CDX. --warc-dedup= CDX . --no-warc-compression WARC GZIP. --no-warc-digests (digests) SHA1. --no-warc-keep-log WARC. --warc-tempdir= WARC. FTP --ftp-user= --ftp-password=_ _ FTP. -wget@ FTP . URL . "ps". .wgetrc .netrc "chmod". --- Wget . --no-remove-listing .listing FTP. FTP. ( ). Wget .listing /etc/passwd "root" Wget . Wget .listing // .listing .listing.number. "root" Wget . index.html /etc/passwd "root" Wget -N -r . --no-glob (globbing) FTP. (wildcards) * ? [ ] : wget ftp://gnjilux.srk.fer.hr/*.msg URL . . URL . Wget . FTP ( "ls"). --no-passive-ftp FTP . FTP . FTP . NAT FTP . FTP FTP . "passive_ftp=off" . --preserve-permissions umask. --retr-symlinks FTP . Wget . --retr-symlinks=no . . . " " FTP Wget .LISTING . ( ) . . FTPS --ftps-implicit Wget FTPS . FTPS SSL/TLS . "AUTH TLS": FTPS SSL/TLS . FTPS ( "PBSZ" "PROT" ). FTPS FTPS . --ftps-implicit FTPS 990 FTPS "" () FTP 21. --no-ftps-resume-ssl SSL/TLS . Wget SSL/TLS . SSL/TLS SSL/TLS . FTPS Wget . SSL/TLS . --no-ftps-resume-ssl. --ftps-clear-data-connection . SSL/TLS. Wget "PROT C" . --ftps-fallback-to-ftp FTP FTPS . . . "AUTH TLS" FTPS SSL/TLS FTPS. -r --recursive . 5. -l --level= Wget . 5 5 (URL) . -l 0 -l inf . wget -r -l 0 http://<>/1.html 1.html -l 0 -l inf--- . HTML ( ) -r -l. HTML page requisites. --delete-after Wget . : wget -r -nd --delete-after http://whatever.com/~popular/page/ -r -nd . --delete-after . DELE FTP . --delete-after --convert-links .orig . -k --convert-links . HTML . : o Wget . : /foo/doc.html /bar/img.gif doc.html ../bar/img.gif. . o Wget . : /foo/doc.html /bar/img.gif ( ../bar/img.gif) doc.html http://hostname/bar/img.gif. : . . Wget . -k . --convert-file-only (URLs) . " " . --adjust-extension . . : //foo.com/bar.cgi?xyz --adjust-extension ./foo.com/bar.cgi?xyz.css //foo.com/bar.cgi?xyz.css. . ("//") Wget ( "http://"). -K --backup-converted .orig. -N. -m --mirror . FTP. -r -N -l inf --no-remove-listing. -p --page-requisites Wget HTML . . HTML . -r -l Wget " " . 1.html "" 1.gif "" 2.html. 2.html 2.gif 3.html. . : wget -r -l 2 http://<>/1.html 1.html 1.gif 2.html 2.gif 3.html. 3.html 3.gif Wget ( 2) 1.html . : wget -r -l 2 -p http://<>/1.html 3.html 3.gif . wget -r -l 1 -p http://<>/1.html 1.html 1.gif 2.html 2.gif. : wget -r -l 0 -p http://<>/1.html 1.html 1.gif -l 0 -l inf--- . HTML ( -i) -r -l: wget -p http://<>/1.html Wget -r . . ( ) -p: wget -E -H -k -K -p http://<>/<> Wget (URL) "" "" "" "". --strict-comments HTML. -->. HTML SGML. > --. HTML " " SGML . . HTML . (!). -- . : . 1.9 Wget . 1.9 Wget "" -->. . / -A _ --accept _ -R _ --reject _ . * ? [ ] _ _ . -A "*.mp3" -A '*.mp3'. --accept-regex __ --reject-regex __ (URL) . --regex-type __ . posix pcre. pcre wget libpcre. -D _ --domains=_ . _ . -H. --exclude-domains _ . --follow-ftp FTP HTML. Wget FTP. --follow-tags= Wget ( HTML / ) . . --ignore-tags= --follow-tags. HTML . : wget --ignore-tags=a,area -H -k -K -r http://<>/<> "" . Wget "" . --page-requisites . --ignore-case . -R -A -I -X FTP. -A "*.txt" file1.txt file2.TXT file3.TxT . . -H --span-hosts . -L --relative . . -I --include-directories= . . -X --exclude-directories= . . -np --no-parent . . Wget HTTP FTP. Wget : http_proxy https_proxy http_proxy https_proxy (URLs) HTTP HTTPS . ftp_proxy FTP. http_proxy ftp_proxy . no_proxy . no_proxy .mit.edu MIT. Wget . 0 . 1 . 2 --- .wgetrc .netrc... 3 / . 4 . 5 SSL. 6 / . 7 . 8 . 0 1 . Wget 1.12 Wget . 0 () . /usr/local/etc/wgetrc . .wgetrc . GNU Wget ( ) . ( ...). . 1. . (Wget) . . . 2. . wget -rl0 -kKE -t5 --no-proxy http://example.com -o /tmp/log . . .wgetrc . .wgetrc . .wgetrc . 3. -d ( ). --- . : . "-d" . . 4. "gdb `which wget` core" "where" . core . GNU Wget. .wgetrc -e GNU Info wget. wget2(1) GNU Wget HTTP/2. Hrvoje Niksic . Darshit Shah Tim Ruhsen . (c) 1996--2011, 2015, 2018--2024 . / (GNU Free Documentation License) 1.3 . "GNU Free Documentation License". 3 . . : . 1.25.0 7 2025 WGET(1)