⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wget.pod

📁 一个从网络上自动下载文件的自由工具
💻 POD
📖 第 1 页 / 共 5 页
字号:
		# Log in to the server.  This can be done only once.	wget --save-cookies cookies.txt \	     --post-data 'user=foo&password=bar' \	     http://server.com/auth.php		# Now grab the page or pages we care about.	wget --load-cookies cookies.txt \	     -p http://server.com/interesting/article.phpIf the server is using session cookies to track user authentication,the above will not work because B<--save-cookies> will not savethem (and neither will browsers) and the F<cookies.txt> file willbe empty.  In that case use B<--keep-session-cookies> along withB<--save-cookies> to force saving of session cookies.=item B<--content-disposition>If this is set to on, experimental (not fully-functional) support forC<Content-Disposition> headers is enabled. This can currently result inextra round-trips to the server for a C<HEAD> request, and is knownto suffer from a few bugs, which is why it is not currently enabled by default.This option is useful for some file-downloading CGI programs that useC<Content-Disposition> headers to describe what the name of adownloaded file should be.=back=head2 HTTPS (SSL/TLS) OptionsTo support encrypted HTTP (HTTPS) downloads, Wget must be compiledwith an external SSL library, currently OpenSSL.  If Wget is compiledwithout SSL support, none of these options are available.=over 4=item B<--secure-protocol=>I<protocol>Choose the secure protocol to be used.  Legal values are B<auto>,B<SSLv2>, B<SSLv3>, and B<TLSv1>.  If B<auto> is used,the SSL library is given the liberty of choosing the appropriateprotocol automatically, which is achieved by sending an SSLv2 greetingand announcing support for SSLv3 and TLSv1.  This is the default.Specifying B<SSLv2>, B<SSLv3>, or B<TLSv1> forces the useof the corresponding protocol.  This is useful when talking to old andbuggy SSL server implementations that make it hard for OpenSSL tochoose the correct protocol version.  Fortunately, such servers arequite rare.=item B<--no-check-certificate>Don't check the server certificate against the available certificateauthorities.  Also don't require the URL host name to match the commonname presented by the certificate.As of Wget 1.10, the default is to verify the server's certificateagainst the recognized certificate authorities, breaking the SSLhandshake and aborting the download if the verification fails.Although this provides more secure downloads, it does breakinteroperability with some sites that worked with previous Wgetversions, particularly those using self-signed, expired, or otherwiseinvalid certificates.  This option forces an "insecure" mode ofoperation that turns the certificate verification errors into warningsand allows you to proceed.If you encounter "certificate verification" errors or ones sayingthat "common name doesn't match requested host name", you can usethis option to bypass the verification and proceed with the download.I<Only use this option if you are otherwise convinced of thesite's authenticity, or if you really don't care about the validity ofits certificate.>  It is almost always a bad idea not to check thecertificates when transmitting confidential or important data.=item B<--certificate=>I<file>Use the client certificate stored in I<file>.  This is needed forservers that are configured to require certificates from the clientsthat connect to them.  Normally a certificate is not required and thisswitch is optional.=item B<--certificate-type=>I<type>Specify the type of the client certificate.  Legal values areB<PEM> (assumed by default) and B<DER>, also known asB<ASN1>.=item B<--private-key=>I<file>Read the private key from I<file>.  This allows you to provide theprivate key in a file separate from the certificate.=item B<--private-key-type=>I<type>Specify the type of the private key.  Accepted values are B<PEM>(the default) and B<DER>.=item B<--ca-certificate=>I<file>Use I<file> as the file with the bundle of certificate authorities("CA") to verify the peers.  The certificates must be in PEM format.Without this option Wget looks for CA certificates at thesystem-specified locations, chosen at OpenSSL installation time.=item B<--ca-directory=>I<directory>Specifies directory containing CA certificates in PEM format.  Eachfile contains one CA certificate, and the file name is based on a hashvalue derived from the certificate.  This is achieved by processing acertificate directory with the C<c_rehash> utility supplied withOpenSSL.  Using B<--ca-directory> is more efficient thanB<--ca-certificate> when many certificates are installed becauseit allows Wget to fetch certificates on demand.Without this option Wget looks for CA certificates at thesystem-specified locations, chosen at OpenSSL installation time.=item B<--random-file=>I<file>Use I<file> as the source of random data for seeding thepseudo-random number generator on systems without F</dev/random>.On such systems the SSL library needs an external source of randomnessto initialize.  Randomness may be provided by EGD (seeB<--egd-file> below) or read from an external source specified bythe user.  If this option is not specified, Wget looks for random datain C<$RANDFILE> or, if that is unset, in F<$HOME/.rnd>.  Ifnone of those are available, it is likely that SSL encryption will notbe usable.If you're getting the "Could not seed OpenSSL PRNG; disabling SSL." error, you should provide random data using some of the methodsdescribed above.=item B<--egd-file=>I<file>Use I<file> as the EGD socket.  EGD stands for I<EntropyGathering Daemon>, a user-space program that collects data fromvarious unpredictable system sources and makes it available to otherprograms that might need it.  Encryption software, such as the SSLlibrary, needs sources of non-repeating randomness to seed the randomnumber generator used to produce cryptographically strong keys.OpenSSL allows the user to specify his own source of entropy using theC<RAND_FILE> environment variable.  If this variable is unset, orif the specified file does not produce enough randomness, OpenSSL willread random data from EGD socket specified using this option.If this option is not specified (and the equivalent startup command isnot used), EGD is never contacted.  EGD is not needed on modern Unixsystems that support F</dev/random>.=back=head2 FTP Options=over 4=item B<--ftp-user=>I<user>=item B<--ftp-password=>I<password>Specify the username I<user> and password I<password> on anFTP server.  Without this, or the corresponding startup option, the password defaults to B<-wget@>, normally used for anonymous FTP.Another way to specify username and password is in the URL itself.  Either method reveals your password to anyone whobothers to run C<ps>.  To prevent the passwords from being seen,store them in F<.wgetrc> or F<.netrc>, and make sure to protectthose files from other users with C<chmod>.  If the passwords arereally important, do not leave them lying in those files either---editthe files and delete them after Wget has started the download.=item B<--no-remove-listing>Don't remove the temporary F<.listing> files generated by FTPretrievals.  Normally, these files contain the raw directory listingsreceived from FTP servers.  Not removing them can be useful fordebugging purposes, or when you want to be able to easily check on thecontents of remote server directories (e.g. to verify that a mirroryou're running is complete).Note that even though Wget writes to a known filename for this file,this is not a security hole in the scenario of a user makingF<.listing> a symbolic link to F</etc/passwd> or something andasking C<root> to run Wget in his or her directory.  Depending onthe options used, either Wget will refuse to write to F<.listing>,making the globbing/recursion/time-stamping operation fail, or thesymbolic link will be deleted and replaced with the actualF<.listing> file, or the listing will be written to aF<.listing.I<number>> file.Even though this situation isn't a problem, though, C<root> shouldnever run Wget in a non-trusted user's directory.  A user could dosomething as simple as linking F<index.html> to F</etc/passwd>and asking C<root> to run Wget with B<-N> or B<-r> so the filewill be overwritten.=item B<--no-glob>Turn off FTP globbing.  Globbing refers to the use of shell-likespecial characters (I<wildcards>), like B<*>, B<?>, B<[>and B<]> to retrieve more than one file from the same directory atonce, like:		wget ftp://gnjilux.srk.fer.hr/*.msgBy default, globbing will be turned on if the URL contains aglobbing character.  This option may be used to turn globbing on or offpermanently.You may have to quote the URL to protect it from being expanded byyour shell.  Globbing makes Wget look for a directory listing, which issystem-specific.  This is why it currently works only with Unix FTPservers (and the ones emulating Unix C<ls> output).=item B<--no-passive-ftp>Disable the use of the I<passive> FTP transfer mode.  Passive FTPmandates that the client connect to the server to establish the dataconnection rather than the other way around.If the machine is connected to the Internet directly, both passive andactive FTP should work equally well.  Behind most firewall and NATconfigurations passive FTP has a better chance of working.  However,in some rare firewall configurations, active FTP actually works whenpassive FTP doesn't.  If you suspect this to be the case, use thisoption, or set C<passive_ftp=off> in your init file.=item B<--retr-symlinks>Usually, when retrieving FTP directories recursively and a symboliclink is encountered, the linked-to file is not downloaded.  Instead, amatching symbolic link is created on the local filesystem.  Thepointed-to file will not be downloaded unless this recursive retrievalwould have encountered it separately and downloaded it anyway.When B<--retr-symlinks> is specified, however, symbolic links aretraversed and the pointed-to files are retrieved.  At this time, thisoption does not cause Wget to traverse symlinks to directories andrecurse through them, but in the future it should be enhanced to dothis.Note that when retrieving a file (not a directory) because it wasspecified on the command-line, rather than because it was recursed to,this option has no effect.  Symbolic links are always traversed in thiscase.=item B<--no-http-keep-alive>Turn off the "keep-alive" feature for HTTP downloads.  Normally, Wgetasks the server to keep the connection open so that, when you downloadmore than one document from the same server, they get transferred overthe same TCP connection.  This saves time and at the same time reducesthe load on the server.This option is useful when, for some reason, persistent (keep-alive)connections don't work for you, for example due to a server bug or dueto the inability of server-side scripts to cope with the connections.=back=head2 Recursive Retrieval Options=over 4=item B<-r>=item B<--recursive>Turn on recursive retrieving.  =item B<-l> I<depth>=item B<--level=>I<depth>Specify recursion maximum depth level I<depth>.  The default maximum depth is 5.=item B<--delete-after>This option tells Wget to delete every single file it downloads,I<after> having done so.  It is useful for pre-fetching popularpages through a proxy, e.g.:		wget -r -nd --delete-after http://whatever.com/~popular/page/The B<-r> option is to retrieve recursively, and B<-nd> to notcreate directories.  Note that B<--delete-after> deletes files on the local machine.  Itdoes not issue the B<DELE> command to remote FTP sites, forinstance.  Also note that when B<--delete-after> is specified,B<--convert-links> is ignored, so B<.orig> files are simply notcreated in the first place.=item B<-k>=item B<--convert-links>After the download is complete, convert the links in the document tomake them suitable for local viewing.  This affects not only the visiblehyperlinks, but any part of the document that links to external content,such as embedded images, links to style sheets, hyperlinks to non-HTMLcontent, etc.Each link will be changed in one of the two ways:=over 4=item *The links to files that have been downloaded by Wget will be changed torefer to the file they point to as a relative link.Example: if the downloaded file F</foo/doc.html> links toF</bar/img.gif>, also downloaded, then the link in F<doc.html>will be modified to point to B<../bar/img.gif>.  This kind oftransformation works reliably for arbitrary combinations of directories.=item *The links to files that have not been downloaded by Wget will be changedto include host name and absolute path of the location they point to.Example: if the downloaded file F</foo/doc.html> links toF</bar/img.gif> (or to F<../bar/img.gif>), then the link inF<doc.html> will be modified to point toF<http://I<hostname>/bar/img.gif>.=backBecause of this, local browsing works reliably: if a linked file wasdownloaded, the link will refer to its local name; if it was notdownloaded, the link will refer to its full Internet address rather thanpresenting a broken link.  The fact that the former links are convertedto relative links ensures that you can move the downloaded hierarchy to

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -