GNUWget1171 ThisledocumentstheGNUWgetutilityfordownloadingnetworkdataCopyrightc 19961997199819992000200120022003200420052006200720082009201020112015FreeSoftwareFoundationIncPermi ID: 354564
Download Pdf The PPT/PDF document "Thenon-interactivedownloadutilityUpdated..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
GNUWget1.20 Thenon-interactivedownloadutilityUpdatedforWget1.20,13November2018byHrvojeNiksicandothers ThisledocumentstheGNUWgetutilityfordownloadingnetworkdata.Copyrightc 1996-2011,2015,2018FreeSoftwareFoundation,Inc.Permissionisgrantedtomakeanddistributeverbatimcopiesofthismanualprovidedthecopy-rightnoticeandthispermissionnoticearepreservedonallcopies.Permissionisgrantedtocopy,distributeand/ormodifythisdocumentunderthetermsoftheGNUFreeDocumentationLicense,Version1.3oranylaterversionpublishedbytheFreeSoftwareFoundation;withnoInvariantSections,withnoFront-CoverTexts,andwithnoBack-CoverTexts.Acopyofthelicenseisincludedinthesectionentitled\GNUFreeDocumentationLicense". i TableofContents1Overview:::::::::::::::::::::::::::::::::::::::::::::::::::::::: 1 2Invoking::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 2 2.1URLFormat::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 2 2.2OptionSyntax::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 3 2.3BasicStartupOptions::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 3 2.4LoggingandInputFileOptions:::::::::::::::::::::::::::::::::::::::::::::::::::: 4 2.5DownloadOptions::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 6 2.6DirectoryOptions:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 14 2.7HTTPOptions::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 15 2.8HTTPS(SSL/TLS)Options:::::::::::::::::::::::::::::::::::::::::::::::::::::: 21 2.9FTPOptions::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 25 2.10FTPSOptions::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 26 2.11RecursiveRetrievalOptions:::::::::::::::::::::::::::::::::::::::::::::::::::::: 27 2.12RecursiveAccept/RejectOptions:::::::::::::::::::::::::::::::::::::::::::::::: 30 2.13ExitStatus:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 31 3RecursiveDownload:::::::::::::::::::::::::::::::::::::::::: 33 4FollowingLinks::::::::::::::::::::::::::::::::::::::::::::::: 34 4.1SpanningHosts::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 34 4.2TypesofFiles:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 34 4.3Directory-BasedLimits::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 36 4.4RelativeLinks:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 37 4.5FollowingFTPLinks::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 37 5Time-Stamping:::::::::::::::::::::::::::::::::::::::::::::::: 38 5.1Time-StampingUsage:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 38 5.2HTTPTime-StampingInternals:::::::::::::::::::::::::::::::::::::::::::::::::: 39 5.3FTPTime-StampingInternals:::::::::::::::::::::::::::::::::::::::::::::::::::: 39 6StartupFile::::::::::::::::::::::::::::::::::::::::::::::::::: 40 6.1WgetrcLocation:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 40 6.2WgetrcSyntax::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 40 6.3WgetrcCommands::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 40 6.4SampleWgetrc::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 47 7Examples:::::::::::::::::::::::::::::::::::::::::::::::::::::: 51 7.1SimpleUsage::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 51 7.2AdvancedUsage:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 51 7.3VeryAdvancedUsage::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 52 ii 8Various::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 54 8.1Proxies::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 54 8.2Distribution:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 55 8.3WebSite::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 55 8.4MailingLists::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 55 PrimaryList:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 55 ObsoleteLists:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 55 8.5InternetRelayChat:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 55 8.6ReportingBugs::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 55 8.7Portability:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 56 8.8Signals::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 57 9Appendices:::::::::::::::::::::::::::::::::::::::::::::::::::: 58 9.1RobotExclusion:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 58 9.2SecurityConsiderations::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 59 9.3Contributors:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 59 AppendixACopyingthismanual:::::::::::::::::::::::::::::: 61 A.1GNUFreeDocumentationLicense:::::::::::::::::::::::::::::::::::::::::::::::: 61 ConceptIndex:::::::::::::::::::::::::::::::::::::::::::::::::::: 68 1 1OverviewGNUWgetisafreeutilityfornon-interactivedownloadoflesfromtheWeb.Itsupportshttp,https,andftpprotocols,aswellasretrievalthroughhttpproxies.ThischapterisapartialoverviewofWget'sfeatures.Wgetisnon-interactive,meaningthatitcanworkinthebackground,whiletheuserisnotloggedon.Thisallowsyoutostartaretrievalanddisconnectfromthesystem,lettingWgetnishthework.Bycontrast,mostoftheWebbrowsersrequireconstantuser'spresence,whichcanbeagreathindrancewhentransferringalotofdata.Wgetcanfollowlinksinhtml,xhtml,andcsspages,tocreatelocalversionsofremotewebsites,fullyrecreatingthedirectorystructureoftheoriginalsite.Thisissometimesreferredtoas\recursivedownloading."Whiledoingthat,WgetrespectstheRobotExclusionStandard(/robots.txt).Wgetcanbeinstructedtoconvertthelinksindownloadedlestopointatthelocalles,foroineviewing.Filenamewildcardmatchingandrecursivemirroringofdirectoriesareavailablewhenre-trievingviaftp.Wgetcanreadthetime-stampinformationgivenbybothhttpandftpservers,andstoreitlocally.ThusWgetcanseeiftheremotelehaschangedsincelastretrieval,andautomaticallyretrievethenewversionifithas.ThismakesWgetsuitableformirroringofftpsites,aswellashomepages.Wgethasbeendesignedforrobustnessoversloworunstablenetworkconnections;ifadownloadfailsduetoanetworkproblem,itwillkeepretryinguntilthewholelehasbeenretrieved.Iftheserversupportsregetting,itwillinstructtheservertocontinuethedownloadfromwhereitlefto.Wgetsupportsproxyservers,whichcanlightenthenetworkload,speedupretrievalandprovideaccessbehindrewalls.Wgetusesthepassiveftpdownloadingbydefault,activeftpbeinganoption.WgetsupportsIPversion6,thenextgenerationofIP.IPv6isautodetectedatcompile-time,andcanbedisabledateitherbuildorruntime.BinariesbuiltwithIPv6supportworkwellinbothIPv4-onlyanddualfamilyenvironments.Built-infeaturesoermechanismstotunewhichlinksyouwishtofollow(see Chapter4[FollowingLinks],page34 ).Theprogressofindividualdownloadsistracedusingaprogressgauge.Interactivedownloadsaretrackedusinga\thermometer"-stylegauge,whereasnon-interactiveonesaretracedwithdots,eachdotrepresentingaxedamountofdatareceived(1KBbydefault).Eithergaugecanbecustomizedtoyourpreferences.Mostofthefeaturesarefullycongurable,eitherthroughcommandlineoptions,orviatheinitializationle.wgetrc(see Chapter6[StartupFile],page40 ).Wgetallowsyoutodeneglobalstartuples(/usr/local/etc/wgetrcbydefault)forsitesettings.Youcanalsospecifythelocationofastartuplewiththe{congoption.Todisablethereadingofcongles,use{no-cong.Ifboth{congand{no-congaregiven,{no-congisignored.Finally,GNUWgetisfreesoftware.Thismeansthateveryonemayuseit,redistributeitand/ormodifyitunderthetermsoftheGNUGeneralPublicLicense,aspublishedbytheFreeSoftwareFoundation(seetheleCOPYINGthatcamewithGNUWget,fordetails). 2 2InvokingBydefault,Wgetisverysimpletoinvoke.Thebasicsyntaxis:wget[option]...[URL]...Wgetwillsimplydownloadalltheurlsspeciedonthecommandline.URLisaUniformResourceLocator,asdenedbelow.However,youmaywishtochangesomeofthedefaultparametersofWget.Youcandoittwoways:permanently,addingtheappropriatecommandto.wgetrc(see Chapter6[StartupFile],page40 ),orspecifyingitonthecommandline.2.1URLFormatURLisanacronymforUniformResourceLocator.AuniformresourcelocatorisacompactstringrepresentationforaresourceavailableviatheInternet.Wgetrecognizestheurlsyntaxasperrfc1738.Thisisthemostwidelyusedform(squarebracketsdenoteoptionalparts):http://host[:port]/directory/fileftp://host[:port]/directory/fileYoucanalsoencodeyourusernameandpasswordwithinaurl:ftp://user:password@host/pathhttp://user:password@host/pathEitheruserorpassword,orboth,maybeleftout.Ifyouleaveouteitherthehttpusernameorpassword,noauthenticationwillbesent.Ifyouleaveouttheftpusername,`anonymous'willbeused.Ifyouleaveouttheftppassword,youremailaddresswillbesuppliedasadefaultpassword.1ImportantNote:ifyouspecifyapassword-containingurlonthecommandline,theuser-nameandpasswordwillbeplainlyvisibletoallusersonthesystem,bywayofps.Onmulti-usersystems,thisisabigsecurityrisk.Toworkaroundit,usewget-i-andfeedtheurlstoWget'sstandardinput,eachonaseparateline,terminatedbyC-d.Youcanencodeunsafecharactersinaurlas`%xy',xybeingthehexadecimalrepresentationofthecharacter'sasciivalue.Somecommonunsafecharactersinclude`%'(quotedas`%25'),`:'(quotedas`%3A'),and`@'(quotedas`%40').Refertorfc1738foracomprehensivelistofunsafecharacters.Wgetalsosupportsthetypefeatureforftpurls.Bydefault,ftpdocumentsareretrievedinthebinarymode(type`i'),whichmeansthattheyaredownloadedunchanged.Anotherusefulmodeisthe`a'(ASCII)mode,whichconvertsthelinedelimitersbetweenthedierentoperatingsystems,andisthususefulfortextles.Hereisanexample:ftp://host/directory/file;type=aTwoalternativevariantsofurlspecicationarealsosupported,becauseofhistorical(hys-terical?)reasonsandtheirwidespreadeduse.ftp-onlysyntax(supportedbyNcFTP):host:/dir/filehttp-onlysyntax(introducedbyNetscape):host[:port]/dir/fileThesetwoalternativeformsaredeprecated,andmayceasebeingsupportedinthefuture.Ifyoudonotunderstandthedierencebetweenthesenotations,ordonotknowwhichonetouse,justusetheplainordinaryformatyouusewithyourfavoritebrowser,likeLynxorNetscape. 1Ifyouhavea.netrcleinyourhomedirectory,passwordwillalsobesearchedforthere. Chapter2:Invoking3 2.2OptionSyntaxSinceWgetusesGNUgetopttoprocesscommand-linearguments,everyoptionhasalongformalongwiththeshortone.Longoptionsaremoreconvenienttoremember,buttaketimetotype.Youmayfreelymixdierentoptionstyles,orspecifyoptionsafterthecommand-linearguments.Thusyoumaywrite:wget-r--tries=10http://fly.srk.fer.hr/-ologThespacebetweentheoptionacceptinganargumentandtheargumentmaybeomitted.Insteadof`-olog'youcanwrite`-olog'.Youmayputseveraloptionsthatdonotrequireargumentstogether,like:wget-drcURLThisiscompletelyequivalentto:wget-d-r-cURLSincetheoptionscanbespeciedafterthearguments,youmayterminatethemwith`--'.Sothefollowingwilltrytodownloadurl`-x',reportingfailuretolog:wget-olog---xTheoptionsthatacceptcomma-separatedlistsallrespecttheconventionthatspecifyinganemptylistclearsitsvalue.Thiscanbeusefultoclearthe.wgetrcsettings.Forinstance,ifyour.wgetrcsetsexclude_directoriesto/cgi-bin,thefollowingexamplewillrstresetit,andthensetittoexclude/~nobodyand/~somebody.Youcanalsoclearthelistsin.wgetrc(see Section6.2[WgetrcSyntax],page40 ).wget-X''-X/~nobody,/~somebodyMostoptionsthatdonotacceptargumentsarebooleanoptions,sonamedbecausetheirstatecanbecapturedwithayes-or-no(\boolean")variable.Forexample,`--follow-ftp'tellsWgettofollowFTPlinksfromHTMLlesand,ontheotherhand,`--no-glob'tellsitnottoperformleglobbingonFTPURLs.Abooleanoptioniseitherarmativeornegative(beginningwith`--no').Allsuchoptionsshareseveralproperties.Unlessstatedotherwise,itisassumedthatthedefaultbehavioristheoppositeofwhattheoptionaccomplishes.Forexample,thedocumentedexistenceof`--follow-ftp'assumesthatthedefaultistonotfollowFTPlinksfromHTMLpages.Armativeoptionscanbenegatedbyprependingthe`--no-'totheoptionname;negativeoptionscanbenegatedbyomittingthe`--no-'prex.Thismightseemsuper uous|ifthedefaultforanarmativeoptionistonotdosomething,thenwhyprovideawaytoexplicitlyturnito?Butthestartuplemayinfactchangethedefault.Forinstance,usingfollow_ftp=onin.wgetrcmakesWgetfollowFTPlinksbydefault,andusing`--no-follow-ftp'istheonlywaytorestorethefactorydefaultfromthecommandline.2.3BasicStartupOptions`-V'`--version'DisplaytheversionofWget.`-h'`--help'PrintahelpmessagedescribingallofWget'scommand-lineoptions.`-b'`--background'Gotobackgroundimmediatelyafterstartup.Ifnooutputleisspeciedviathe`-o',outputisredirectedtowget-log. Chapter2:Invoking4 `-ecommand'`--executecommand'Executecommandasifitwereapartof.wgetrc(see Chapter6[StartupFile],page40 ).Acommandthusinvokedwillbeexecutedafterthecommandsin.wgetrc,thustakingprecedenceoverthem.Ifyouneedtospecifymorethanonewgetrccommand,usemultipleinstancesof`-e'.2.4LoggingandInputFileOptions`-ologfile'`--output-file=logfile'Logallmessagestologle.Themessagesarenormallyreportedtostandarderror.`-alogfile'`--append-output=logfile'Appendtologle.Thisisthesameas`-o',onlyitappendstologleinsteadofoverwritingtheoldlogle.Iflogledoesnotexist,anewleiscreated.`-d'`--debug'Turnondebugoutput,meaningvariousinformationimportanttothedevelopersofWgetifitdoesnotworkproperly.YoursystemadministratormayhavechosentocompileWgetwithoutdebugsupport,inwhichcase`-d'willnotwork.Pleasenotethatcompilingwithdebugsupportisalwayssafe|Wgetcompiledwiththedebugsupportwillnotprintanydebuginfounlessrequestedwith`-d'.See Section8.6[ReportingBugs],page55 ,formoreinformationonhowtouse`-d'forsendingbugreports.`-q'`--quiet'TurnoWget'soutput.`-v'`--verbose'Turnonverboseoutput,withalltheavailabledata.Thedefaultoutputisverbose.`-nv'`--no-verbose'Turnoverbosewithoutbeingcompletelyquiet(use`-q'forthat),whichmeansthaterrormessagesandbasicinformationstillgetprinted.`--report-speed=type'Outputbandwidthastype.Theonlyacceptedvalueis`bits'.`-ifile'`--input-file=file'Readurlsfromalocalorexternalle.If`-'isspeciedasle,urlsarereadfromthestandardinput.(Use`./-'toreadfromaleliterallynamed`-'.)Ifthisfunctionisused,nourlsneedbepresentonthecommandline.Ifthereareurlsbothonthecommandlineandinaninputle,thoseonthecommandlineswillbetherstonestoberetrieved.If`--force-html'isnotspecied,thenleshouldconsistofaseriesofURLs,oneperline.However,ifyouspecify`--force-html',thedocumentwillberegardedas`html'.Inthatcaseyoumayhaveproblemswithrelativelinks,whichyoucansolveeitherbyaddinghref="urlºse;-333;"tothedocumentsorbyspecifying`--base=url'onthecommandline. Chapter2:Invoking5 Iftheleisanexternalone,thedocumentwillbeautomaticallytreatedas`html'iftheContent-Typematches`text/html'.Furthermore,thele'slocationwillbeimplicitlyusedasbasehrefifnonewasspecied.`--input-metalink=file'DownloadslescoveredinlocalMetalinkle.Metalinkversion3and4aresup-ported.`--keep-badhash'KeepsdownloadedMetalink'sleswithabadhash.Itappends.badhashtothenameofMetalink'sleswhichhaveachecksummismatch,exceptwithoutoverwritingexistingles.`--metalink-over-http'IssuesHTTPHEADrequestinsteadofGETandextractsMetalinkmetadatafromresponseheaders.ThenitswitchestoMetalinkdownload.IfnovalidMetalinkmeta-dataisfound,itfallsbacktoordinaryHTTPdownload.Enables`Content-Type:application/metalink4+xml'lesdownload/processing.`--metalink-index=number'SettheMetalink`application/metalink4+xml'metaurlordinalNUMBER.From1tothetotalnumberof\application/metalink4+xml"available.Specify0or`inf'tochoosetherstgoodone.Metaurls,suchasthosefroma`--metalink-over-http',mayhavebeensortedbyprioritykey'svalue;keepthisinmindtochoosetherightNUMBER.`--preferred-location'SetpreferredlocationforMetalinkresources.Thishaseectifmultipleresourceswithsamepriorityareavailable.`-F'`--force-html'Wheninputisreadfromale,forceittobetreatedasanhtmlle.Thisenablesyoutoretrieverelativelinksfromexistinghtmllesonyourlocaldisk,byaddinghref="urlºse;-333;"tohtml,orusingthe`--base'command-lineoption.`-BURL'`--base=URL'ResolvesrelativelinksusingURLasthepointofreference,whenreadinglinksfromanHTMLlespeciedviathe`-i'/`--input-file'option(togetherwith`--force-html',orwhentheinputlewasfetchedremotelyfromaserverdescribingitashtml).ThisisequivalenttothepresenceofaBASEtaginthehtmlinputle,withURLasthevalueforthehrefattribute.Forinstance,ifyouspecify`http://foo/bar/a.html'forURL,andWgetreads`../baz/b.html'fromtheinputle,itwouldberesolvedto`http://foo/baz/b.html'.`--config=FILE'Specifythelocationofastartupleyouwishtouseinsteadofthedefaultone(s).Use{no-congtodisablereadingofcongles.Ifboth{congand{no-congaregiven,{no-congisignored.`--rejected-log=logfile'LogsallURLrejectionstologleascommaseparatedvalues.Thevaluesincludethereasonofrejection,theURLandtheparentURLitwasfoundin. Chapter2:Invoking6 2.5DownloadOptions`--bind-address=ADDRESS'WhenmakingclientTCP/IPconnections,bindtoADDRESSonthelocalmachine.ADDRESSmaybespeciedasahostnameorIPaddress.ThisoptioncanbeusefulifyourmachineisboundtomultipleIPs.`--bind-dns-address=ADDRESS'[libcaresonly]ThisaddressoverridestherouteforDNSrequests.Ifyoueverneedtocircumventthestandardsettingsfrom/etc/resolv.conf,thisoptiontogetherwith`--dns-servers'isyourfriend.ADDRESSmustbespeciedeitherasIPv4orIPv6address.Wgetneedstobebuiltwithlibcaresforthisoptiontobeavailable.`--dns-servers=ADDRESSES'[libcaresonly]Thegivenaddress(es)overridethestandardnameserveraddresses,e.g.asconguredin/etc/resolv.conf.ADDRESSESmaybespeciedeitherasIPv4orIPv6addresses,comma-separated.Wgetneedstobebuiltwithlibcaresforthisoptiontobeavailable.`-tnumber'`--tries=number'Setnumberoftriestonumber.Specify0or`inf'forinniteretrying.Thedefaultistoretry20times,withtheexceptionoffatalerrorslike\connectionrefused"or\notfound"(404),whicharenotretried.`-Ofile'`--output-document=file'Thedocumentswillnotbewrittentotheappropriateles,butallwillbeconcate-natedtogetherandwrittentole.If`-'isusedasle,documentswillbeprintedtostandardoutput,disablinglinkconversion.(Use`./-'toprinttoaleliterallynamed`-'.)Useof`-O'isnotintendedtomeansimply\usethenameleinsteadoftheoneintheURL;"rather,itisanalogoustoshellredirection:`wget-Ofilehttp://foo'isintendedtoworklike`wget-O-http://foofile';filewillbetruncatedimmediately,andalldownloadedcontentwillbewrittenthere.Forthisreason,`-N'(fortimestamp-checking)isnotsupportedincombinationwith`-O':sinceleisalwaysnewlycreated,itwillalwayshaveaverynewtimestamp.Awarningwillbeissuedifthiscombinationisused.Similarly,using`-r'or`-p'with`-O'maynotworkasyouexpect:Wgetwon'tjustdownloadtherstletoleandthendownloadtheresttotheirnormalnames:alldownloadedcontentwillbeplacedinle.Thiswasdisabledinversion1.11,buthasbeenreinstated(withawarning)in1.11.2,astherearesomecaseswherethisbehaviorcanactuallyhavesomeuse.Acombinationwith`-nc'isonlyacceptedifthegivenoutputledoesnotexist.Notethatacombinationwith`-k'isonlypermittedwhendownloadingasingledocument,asinthatcaseitwilljustconvertallrelativeURIstoexternalones;`-k'makesnosenseformultipleURIswhenthey'reallbeingdownloadedtoasinglele;`-k'canbeusedonlywhentheoutputisaregularle.`-nc'`--no-clobber'Ifaleisdownloadedmorethanonceinthesamedirectory,Wget'sbehaviorde-pendsonafewoptions,including`-nc'.Incertaincases,thelocallewillbe Chapter2:Invoking7 clobbered,oroverwritten,uponrepeateddownload.Inothercasesitwillbepre-served.WhenrunningWgetwithout`-N',`-nc',`-r',or`-p',downloadingthesameleinthesamedirectorywillresultintheoriginalcopyoflebeingpreservedandthesecondcopybeingnamed`file.1'.Ifthatleisdownloadedyetagain,thethirdcopywillbenamed`file.2',andsoon.(Thisisalsothebehaviorwith`-nd',evenif`-r'or`-p'areineect.)When`-nc'isspecied,thisbehaviorissuppressed,andWgetwillrefusetodownloadnewercopiesof`file'.Therefore,\no-clobber"isactuallyamisnomerinthismode|it'snotclobberingthat'sprevented(asthenumericsuxeswerealreadypreventingclobbering),butratherthemultipleversionsavingthat'sprevented.WhenrunningWgetwith`-r'or`-p',butwithout`-N',`-nd',or`-nc',re-downloadingalewillresultinthenewcopysimplyoverwritingtheold.Adding`-nc'willpreventthisbehavior,insteadcausingtheoriginalversiontobepreservedandanynewercopiesontheservertobeignored.WhenrunningWgetwith`-N',withorwithout`-r'or`-p',thedecisionastowhetherornottodownloadanewercopyofaledependsonthelocalandremotetimestampandsizeofthele(see Chapter5[Time-Stamping],page38 ).`-nc'maynotbespeciedatthesametimeas`-N'.Acombinationwith`-O'/`--output-document'isonlyacceptedifthegivenoutputledoesnotexist.Notethatwhen`-nc'isspecied,leswiththesuxes`.html'or`.htm'willbeloadedfromthelocaldiskandparsedasiftheyhadbeenretrievedfromtheWeb.`--backups=backups'Before(over)writingale,backupanexistinglebyaddinga`.1'sux(`_1'onVMS)tothelename.Suchbackuplesarerotatedto`.2',`.3',andsoon,uptobackups(andlostbeyondthat).`--no-netrc'Donottrytoobtaincredentialsfrom.netrcle.Bydefault.netrcleissearchedforcredentialsincasenonehavebeenpassedoncommandlineandauthenticationisrequired.`-c'`--continue'Continuegettingapartially-downloadedle.ThisisusefulwhenyouwanttonishupadownloadstartedbyapreviousinstanceofWget,orbyanotherprogram.Forinstance:wget-cftp://sunsite.doc.ic.ac.uk/ls-lR.ZIfthereisalenamedls-lR.Zinthecurrentdirectory,Wgetwillassumethatitistherstportionoftheremotele,andwillasktheservertocontinuetheretrievalfromanosetequaltothelengthofthelocalle.Notethatyoudon'tneedtospecifythisoptionifyoujustwantthecurrentinvocationofWgettoretrydownloadingaleshouldtheconnectionbelostmidwaythrough.Thisisthedefaultbehavior.`-c'onlyaectsresumptionofdownloadsstartedpriortothisinvocationofWget,andwhoselocallesarestillsittingaround.Without`-c',thepreviousexamplewouldjustdownloadtheremoteletols-lR.Z.1,leavingthetruncatedls-lR.Zlealone.Ifyouuse`-c'onanon-emptyle,andtheserverdoesnotsupportcontinueddownloading,Wgetwillrestartthedownloadfromscratchandoverwritetheexistingleentirely. Chapter2:Invoking8 BeginningwithWget1.7,ifyouuse`-c'onalewhichisofequalsizeastheoneontheserver,Wgetwillrefusetodownloadtheleandprintanexplanatorymessage.Thesamehappenswhentheleissmallerontheserverthanlocally(presumablybecauseitwaschangedontheserversinceyourlastdownloadattempt)|because\continuing"isnotmeaningful,nodownloadoccurs.Ontheothersideofthecoin,whileusing`-c',anylethat'sbiggerontheserverthanlocallywillbeconsideredanincompletedownloadandonly(length(remote)-length(local))byteswillbedownloadedandtackedontotheendofthelocalle.Thisbehaviorcanbedesirableincertaincases|forinstance,youcanuse`wget-c'todownloadjustthenewportionthat'sbeenappendedtoadatacollectionorlogle.However,iftheleisbiggerontheserverbecauseit'sbeenchanged,asopposedtojustappendedto,you'llendupwithagarbledle.Wgethasnowayofverifyingthatthelocalleisreallyavalidprexoftheremotele.Youneedtobeespeciallycarefulofthiswhenusing`-c'inconjunctionwith`-r',sinceeverylewillbeconsideredasan"incompletedownload"candidate.Anotherinstancewhereyou'llgetagarbledleifyoutrytouse`-c'isifyouhavealamehttpproxythatinsertsa\transferinterrupted"stringintothelocalle.Inthefuturea\rollback"optionmaybeaddedtodealwiththiscase.Notethat`-c'onlyworkswithftpserversandwithhttpserversthatsupporttheRangeheader.`--start-pos=OFFSET'Startdownloadingatzero-basedpositionOFFSET.Osetmaybeexpressedinbytes,kilobyteswiththe`k'sux,ormegabyteswiththe`m'sux,etc.`--start-pos'hashigherprecedenceover`--continue'.When`--start-pos'and`--continue'arebothspecied,wgetwillemitawarningthenproceedasif`--continue'wasabsent.Serversupportforcontinueddownloadisrequired,otherwise`--start-pos'cannothelp.See`-c'fordetails.`--progress=type'Selectthetypeoftheprogressindicatoryouwishtouse.Legalindicatorsare\dot"and\bar".The\bar"indicatorisusedbydefault.Itdrawsanasciiprogressbargraphics(a.k.a\thermometer"display)indicatingthestatusofretrieval.IftheoutputisnotaTTY,the\dot"barwillbeusedbydefault.Use`--progress=dot'toswitchtothe\dot"display.Ittracestheretrievalbyprintingdotsonthescreen,eachdotrepresentingaxedamountofdownloadeddata.Theprogresstypecanalsotakeoneormoreparameters.Theparametersvarybasedonthetypeselected.Parameterstotypearepassedbyappendingthemtothetypesperatedbyacolon(:)likethis:`--progress=type:parameter1:parameter2'.Whenusingthedottedretrieval,youmaysetthestylebyspecifyingthetypeas`dot:style'.Dierentstylesassigndierentmeaningtoonedot.Withthedefaultstyleeachdotrepresents1K,therearetendotsinaclusterand50dotsinaline.Thebinarystylehasamore\computer"-likeorientation|8Kdots,16-dotsclustersand48dotsperline(whichmakesfor384Klines).Themegastyleissuitablefordownloadinglargeles|eachdotrepresents64Kretrieved,thereareeightdotsinacluster,and48dotsoneachline(soeachlinecontains3M).Ifmegaisnotenough Chapter2:Invoking9 thenyoucanusethegigastyle|eachdotrepresents1Mretrieved,thereareeightdotsinacluster,and32dotsoneachline(soeachlinecontains32M).With`--progress=bar',therearecurrentlytwopossibleparameters,forceandnoscroll.WhentheoutputisnotaTTY,theprogressbaralwaysfallsbackto\dot",evenif`--progress=bar'waspassedtoWgetduringinvocation.Thisbehaviourcanbeoverriddenandthe\bar"outputforcedbyusingthe\force"parameteras`--progress=bar:force'.Bydefault,the`bar'styleprogressbarscrollthenameofthelefromlefttorightforthelebeingdownloadedifthelenameexceedsthemaximumlengthallottedforitsdisplay.Incertaincases,suchaswith`--progress=bar:force',onemaynotwantthescrollinglenameintheprogressbar.Bypassingthe\noscroll"parameter,Wgetcanbeforcedtodisplayasmuchofthelenameaspossiblewithoutscrollingthroughit.Notethatyoucansetthedefaultstyleusingtheprogresscommandin.wgetrc.Thatsettingmaybeoverriddenfromthecommandline.Forexample,toforcethebaroutputwithoutscrolling,use`--progress=bar:force:noscroll'.`--show-progress'Forcewgettodisplaytheprogressbarinanyverbosity.Bydefault,wgetonlydisplaystheprogressbarinverbosemode.Onemayhowever,wantwgettodisplaytheprogressbaronscreeninconjunctionwithanyotherverbositymodeslike`--no-verbose'or`--quiet'.Thisisoftenadesiredapropertywheninvokingwgettodownloadseveralsmall/largeles.Insuchacase,wgetcouldsimplybeinvokedwiththisparametertogetamuchcleaneroutputonthescreen.Thisoptionwillalsoforcetheprogressbartobeprintedtostderrwhenusedalongsidethe`--logfile'option.`-N'`--timestamping'Turnontime-stamping.See Chapter5[Time-Stamping],page38 ,fordetails.`--no-if-modified-since'DonotsendIf-Modied-Sinceheaderin`-N'mode.SendpreliminaryHEADrequestinstead.Thishasonlyeectin`-N'mode.`--no-use-server-timestamps'Don'tsetthelocalle'stimestampbytheoneontheserver.Bydefault,whenaleisdownloaded,itstimestampsaresettomatchthosefromtheremotele.Thisallowstheuseof`--timestamping'onsubsequentinvocationsofwget.However,itissometimesusefultobasethelocalle'stimestamponwhenitwasactuallydownloaded;forthatpurpose,the`--no-use-server-timestamps'optionhasbeenprovided.`-S'`--server-response'Printtheheaderssentbyhttpserversandresponsessentbyftpservers.`--spider'Wheninvokedwiththisoption,WgetwillbehaveasaWebspider,whichmeansthatitwillnotdownloadthepages,justcheckthattheyarethere.Forexample,youcanuseWgettocheckyourbookmarks:wget--spider--force-html-ibookmarks.html Chapter2:Invoking10 ThisfeatureneedsmuchmoreworkforWgettogetclosetothefunctionalityofrealwebspiders.`-Tseconds'`--timeout=seconds'Setthenetworktimeouttosecondsseconds.Thisisequivalenttospecifying`--dns-timeout',`--connect-timeout',and`--read-timeout',allatthesametime.Wheninteractingwiththenetwork,Wgetcancheckfortimeoutandaborttheoperationifittakestoolong.Thispreventsanomalieslikehangingreadsandinniteconnects.Theonlytimeoutenabledbydefaultisa900-secondreadtimeout.Settingatimeoutto0disablesitaltogether.Unlessyouknowwhatyouaredoing,itisbestnottochangethedefaulttimeoutsettings.Alltimeout-relatedoptionsacceptdecimalvalues,aswellassubsecondvalues.Forexample,`0.1'secondsisalegal(thoughunwise)choiceoftimeout.Subsecondtimeoutsareusefulforcheckingserverresponsetimesorfortestingnetworklatency.`--dns-timeout=seconds'SettheDNSlookuptimeouttosecondsseconds.DNSlookupsthatdon'tcompletewithinthespeciedtimewillfail.Bydefault,thereisnotimeoutonDNSlookups,otherthanthatimplementedbysystemlibraries.`--connect-timeout=seconds'Settheconnecttimeouttosecondsseconds.TCPconnectionsthattakelongertoestablishwillbeaborted.Bydefault,thereisnoconnecttimeout,otherthanthatimplementedbysystemlibraries.`--read-timeout=seconds'Settheread(andwrite)timeouttosecondsseconds.The\time"ofthistimeoutreferstoidletime:if,atanypointinthedownload,nodataisreceivedformorethanthespeciednumberofseconds,readingfailsandthedownloadisrestarted.Thisoptiondoesnotdirectlyaectthedurationoftheentiredownload.Ofcourse,theremoteservermaychoosetoterminatetheconnectionsoonerthanthisoptionrequires.Thedefaultreadtimeoutis900seconds.`--limit-rate=amount'Limitthedownloadspeedtoamountbytespersecond.Amountmaybeexpressedinbytes,kilobyteswiththe`k'sux,ormegabyteswiththe`m'sux.Forexample,`--limit-rate=20k'willlimittheretrievalrateto20KB/s.Thisisusefulwhen,forwhateverreason,youdon'twantWgettoconsumetheentireavailablebandwidth.Thisoptionallowstheuseofdecimalnumbers,usuallyinconjunctionwithpowersuxes;forexample,`--limit-rate=2.5k'isalegalvalue.NotethatWgetimplementsthelimitingbysleepingtheappropriateamountoftimeafteranetworkreadthattooklesstimethanspeciedbytherate.EventuallythisstrategycausestheTCPtransfertoslowdowntoapproximatelythespeciedrate.However,itmaytakesometimeforthisbalancetobeachieved,sodon'tbesurprisediflimitingtheratedoesn'tworkwellwithverysmallles.`-wseconds'`--wait=seconds'Waitthespeciednumberofsecondsbetweentheretrievals.Useofthisoptionisrecommended,asitlightenstheserverloadbymakingtherequestslessfrequent.Insteadofinseconds,thetimecanbespeciedinminutesusingthemsux,inhoursusinghsux,orindaysusingdsux. Chapter2:Invoking11 Specifyingalargevalueforthisoptionisusefulifthenetworkorthedestinationhostisdown,sothatWgetcanwaitlongenoughtoreasonablyexpectthenetworkerrortobexedbeforetheretry.Thewaitingintervalspeciedbythisfunctionisin uencedby--random-wait,whichsee.`--waitretry=seconds'Ifyoudon'twantWgettowaitbetweeneveryretrieval,butonlybetweenretriesoffaileddownloads,youcanusethisoption.Wgetwilluselinearbacko,waiting1secondaftertherstfailureonagivenle,thenwaiting2secondsafterthesecondfailureonthatle,uptothemaximumnumberofsecondsyouspecify.Bydefault,Wgetwillassumeavalueof10seconds.`--random-wait'SomewebsitesmayperformloganalysistoidentifyretrievalprogramssuchasWgetbylookingforstatisticallysignicantsimilaritiesinthetimebetweenrequests.Thisoptioncausesthetimebetweenrequeststovarybetween0.5and1.5*waitseconds,wherewaitwasspeciedusingthe`--wait'option,inordertomaskWget'spresencefromsuchanalysis.A2001articleinapublicationdevotedtodevelopmentonapopularconsumerplatformprovidedcodetoperformthisanalysisonthe y.ItsauthorsuggestedblockingattheclassCaddressleveltoensureautomatedretrievalprogramswereblockeddespitechangingDHCP-suppliedaddresses.The`--random-wait'optionwasinspiredbythisill-advisedrecommendationtoblockmanyunrelatedusersfromawebsiteduetotheactionsofone.`--no-proxy'Don'tuseproxies,eveniftheappropriate*_proxyenvironmentvariableisdened.See Section8.1[Proxies],page54 ,formoreinformationabouttheuseofproxieswithWget.`-Qquota'`--quota=quota'Specifydownloadquotaforautomaticretrievals.Thevaluecanbespeciedinbytes(default),kilobytes(with`k'sux),ormegabytes(with`m'sux).Notethatquotawillneveraectdownloadingasinglele.Soifyouspecify`wget-Q10khttps://example.com/ls-lR.gz',allofthels-lR.gzwillbedownloaded.Thesamegoesevenwhenseveralurlsarespeciedonthecommand-line.However,quotaisrespectedwhenretrievingeitherrecursively,orfromaninputle.Thusyoumaysafelytype`wget-Q2m-isites'|downloadwillbeabortedwhenthequotaisexceeded.Settingquotato0orto`inf'unlimitsthedownloadquota.`--no-dns-cache'TurnocachingofDNSlookups.Normally,WgetrememberstheIPaddressesitlookedupfromDNSsoitdoesn'thavetorepeatedlycontacttheDNSserverforthesame(typicallysmall)setofhostsitretrievesfrom.Thiscacheexistsinmemoryonly;anewWgetrunwillcontactDNSagain.However,ithasbeenreportedthatinsomesituationsitisnotdesirabletocachehostnames,evenforthedurationofashort-runningapplicationlikeWget.WiththisoptionWgetissuesanewDNSlookup(moreprecisely,anewcalltogethostbynameorgetaddrinfo)eachtimeitmakesanewconnection.Pleasenotethatthisoptionwillnotaectcachingthatmightbeperformedbytheresolvinglibraryorbyanexternalcachinglayer,suchasNSCD. Chapter2:Invoking12 Ifyoudon'tunderstandexactlywhatthisoptiondoes,youprobablywon'tneedit.`--restrict-file-names=modes'ChangewhichcharactersfoundinremoteURLsmustbeescapedduringgenerationoflocallenames.Charactersthatarerestrictedbythisoptionareescaped,i.e.replacedwith`%HH',where`HH'isthehexadecimalnumberthatcorrespondstotherestrictedcharacter.Thisoptionmayalsobeusedtoforceallalphabeticalcasestobeeitherlower-oruppercase.Bydefault,Wgetescapesthecharactersthatarenotvalidorsafeaspartoflenamesonyouroperatingsystem,aswellascontrolcharactersthataretypicallyunprintable.Thisoptionisusefulforchangingthesedefaults,perhapsbecauseyouaredownloadingtoanon-nativepartition,orbecauseyouwanttodisableescapingofthecontrolcharacters,oryouwanttofurtherrestrictcharacterstoonlythoseintheasciirangeofvalues.Themodesareacomma-separatedsetoftextvalues.Theacceptablevaluesare`unix',`windows',`nocontrol',`ascii',`lowercase',and`uppercase'.Thevalues`unix'and`windows'aremutuallyexclusive(onewilloverridetheother),asare`lowercase'and`uppercase'.Thoselastarespecialcases,astheydonotchangethesetofcharactersthatwouldbeescaped,butratherforcelocallepathstobeconvertedeithertolower-oruppercase.When\unix"isspecied,Wgetescapesthecharacter`/'andthecontrolcharactersintheranges0{31and128{159.ThisisthedefaultonUnix-likeoperatingsystems.When\windows"isgiven,Wgetescapesthecharacters`\',`|',`/',`:',`?',`"',`*',`',`]TJ/;ཕ ;.9; ;Tf 5;.728; 0 T; [0;',andthecontrolcharactersintheranges0{31and128{159.Inaddi-tiontothis,WgetinWindowsmodeuses`+'insteadof`:'toseparatehostandportinlocallenames,anduses`@'insteadof`?'toseparatethequerypor-tionofthelenamefromtherest.Therefore,aURLthatwouldbesavedas`www.xemacs.org:4300/search.pl?input=blah'inUnixmodewouldbesavedas`www.xemacs.org+4300/search.pl@input=blah'inWindowsmode.ThismodeisthedefaultonWindows.Ifyouspecify`nocontrol',thentheescapingofthecontrolcharactersisalsoswitchedo.ThisoptionmaymakesensewhenyouaredownloadingURLswhosenamescontainUTF-8characters,onasystemwhichcansaveanddisplaylenamesinUTF-8(somepossiblebytevaluesusedinUTF-8bytesequencesfallintherangeofvaluesdesignatedbyWgetas\controls").The`ascii'modeisusedtospecifythatanybyteswhosevaluesareoutsidetherangeofasciicharacters(thatis,greaterthan127)shallbeescaped.Thiscanbeusefulwhensavinglenameswhoseencodingdoesnotmatchtheoneusedlocally.`-4'`--inet4-only'`-6'`--inet6-only'ForceconnectingtoIPv4orIPv6addresses.With`--inet4-only'or`-4',WgetwillonlyconnecttoIPv4hosts,ignoringAAAArecordsinDNS,andrefusingtoconnecttoIPv6addressesspeciedinURLs.Conversely,with`--inet6-only'or`-6',WgetwillonlyconnecttoIPv6hostsandignoreArecordsandIPv4addresses.Neitheroptionsshouldbeneedednormally.Bydefault,anIPv6-awareWgetwillusetheaddressfamilyspeciedbythehost'sDNSrecord.IftheDNSrespondswithbothIPv4andIPv6addresses,Wgetwilltrytheminsequenceuntilitndsoneitcanconnectto.(Alsosee--prefer-familyoptiondescribedbelow.) Chapter2:Invoking13 TheseoptionscanbeusedtodeliberatelyforcetheuseofIPv4orIPv6addressfamiliesondualfamilysystems,usuallytoaiddebuggingortodealwithbrokennetworkconguration.Onlyoneof`--inet6-only'and`--inet4-only'maybespeciedatthesametime.NeitheroptionisavailableinWgetcompiledwithoutIPv6support.`--prefer-family=none/IPv4/IPv6'Whengivenachoiceofseveraladdresses,connecttotheaddresseswithspeciedaddressfamilyrst.TheaddressorderreturnedbyDNSisusedwithoutchangebydefault.ThisavoidsspuriouserrorsandconnectattemptswhenaccessinghoststhatresolvetobothIPv6andIPv4addressesfromIPv4networks.Forexample,`www.kame.net'resolvesto`2001:200:0:8002:203:47ff:fea5:3085'andto`203.178.141.194'.WhenthepreferredfamilyisIPv4,theIPv4addressisusedrst;whenthepreferredfamilyisIPv6,theIPv6addressisusedrst;ifthespeciedvalueisnone,theaddressorderreturnedbyDNSisusedwithoutchange.Unlike`-4'and`-6',thisoptiondoesn'tinhibitaccesstoanyaddressfamily,itonlychangestheorderinwhichtheaddressesareaccessed.Alsonotethatthereorderingperformedbythisoptionisstable|itdoesn'taectorderofaddressesofthesamefamily.Thatis,therelativeorderofallIPv4addressesandofallIPv6addressesremainsintactinallcases.`--retry-connrefused'Consider\connectionrefused"atransienterrorandtryagain.NormallyWgetgivesuponaURLwhenitisunabletoconnecttothesitebecausefailuretoconnectistakenasasignthattheserverisnotrunningatallandthatretrieswouldnothelp.Thisoptionisformirroringunreliablesiteswhoseserverstendtodisappearforshortperiodsoftime.`--user=user'`--password=password'Specifytheusernameuserandpasswordpasswordforbothftpandhttpleretrieval.Theseparameterscanbeoverriddenusingthe`--ftp-user'and`--ftp-password'optionsforftpconnectionsandthe`--http-user'and`--http-password'optionsforhttpconnections.`--ask-password'Promptforapasswordforeachconnectionestablished.Cannotbespeciedwhen`--password'isbeingused,becausetheyaremutuallyexclusive.`--use-askpass=command'Promptforauserandpasswordusingthespeciedcommand.IfnocommandisspeciedthenthecommandintheenvironmentvariableWGET ASKPASSisused.IfWGET ASKPASSisnotsetthenthecommandintheenvironmentvariableSSH ASKPASSisused.Youcansetthedefaultcommandforuse-askpassinthe.wgetrc.Thatsettingmaybeoverriddenfromthecommandline.`--no-iri'TurnointernationalizedURI(IRI)support.Use`--iri'toturniton.IRIsupportisactivatedbydefault.YoucansetthedefaultstateofIRIsupportusingtheiricommandin.wgetrc.Thatsettingmaybeoverriddenfromthecommandline. Chapter2:Invoking14 `--local-encoding=encoding'ForceWgettouseencodingasthedefaultsystemencoding.ThataectshowWgetconvertsURLsspeciedasargumentsfromlocaletoutf-8forIRIsupport.Wgetusethefunctionnl_langinfo()andthentheCHARSETenvironmentvariabletogetthelocale.Ifitfails,asciiisused.Youcansetthedefaultlocalencodingusingthelocal_encodingcommandin.wgetrc.Thatsettingmaybeoverriddenfromthecommandline.`--remote-encoding=encoding'ForceWgettouseencodingasthedefaultremoteserverencoding.ThataectshowWgetconvertsURIsfoundinlesfromremoteencodingtoutf-8duringarecursivefetch.ThisoptionsisonlyusefulforIRIsupport,fortheinterpretationofnon-asciicharacters.ForHTTP,remoteencodingcanbefoundinHTTPContent-TypeheaderandinHTMLContent-Typehttp-equivmetatag.Youcansetthedefaultencodingusingtheremoteencodingcommandin.wgetrc.Thatsettingmaybeoverriddenfromthecommandline.`--unlink'ForceWgettounlinkleinsteadofclobberingexistingle.Thisoptionisusefulfordownloadingtothedirectorywithhardlinks.2.6DirectoryOptions`-nd'`--no-directories'Donotcreateahierarchyofdirectorieswhenretrievingrecursively.Withthisoptionturnedon,allleswillgetsavedtothecurrentdirectory,withoutclobbering(ifanameshowsupmorethanonce,thelenameswillgetextensions`.n').`-x'`--force-directories'Theoppositeof`-nd'|createahierarchyofdirectories,evenifonewouldnothavebeencreatedotherwise.E.g.`wget-xhttp://fly.srk.fer.hr/robots.txt'willsavethedownloadedletofly.srk.fer.hr/robots.txt.`-nH'`--no-host-directories'Disablegenerationofhost-prexeddirectories.Bydefault,invokingWgetwith`-rhttp://fly.srk.fer.hr/'willcreateastructureofdirectoriesbeginningwithfly.srk.fer.hr/.Thisoptiondisablessuchbehavior.`--protocol-directories'Usetheprotocolnameasadirectorycomponentoflocallenames.Forexample,withthisoption,`wget-rhttp://host'willsaveto`http/host/...'ratherthanjustto`host/...'.`--cut-dirs=number'Ignorenumberdirectorycomponents.Thisisusefulforgettingane-grainedcontroloverthedirectorywhererecursiveretrievalwillbesaved.Take,forexample,thedirectoryat`ftp://ftp.xemacs.org/pub/xemacs/'.Ifyouretrieveitwith`-r',itwillbesavedlocallyunderftp.xemacs.org/pub/xemacs/.Whilethe`-nH'optioncanremovetheftp.xemacs.org/part,youarestillstuckwithpub/xemacs.Thisiswhere`--cut-dirs'comesinhandy;itmakesWget Chapter2:Invoking15 not\see"numberremotedirectorycomponents.Hereareseveralexamplesofhow`--cut-dirs'optionworks.Nooptions-ftp.xemacs.org/pub/xemacs/-nH-pub/xemacs/-nH--cut-dirs=1-xemacs/-nH--cut-dirs=2-.--cut-dirs=1-ftp.xemacs.org/xemacs/...Ifyoujustwanttogetridofthedirectorystructure,thisoptionissimilartoacombinationof`-nd'and`-P'.However,unlike`-nd',`--cut-dirs'doesnotlosewithsubdirectories|forinstance,with`-nH--cut-dirs=1',abeta/subdirectorywillbeplacedtoxemacs/beta,asonewouldexpect.`-Pprefix'`--directory-prefix=prefix'Setdirectoryprextoprex.Thedirectoryprexisthedirectorywhereallotherlesandsubdirectorieswillbesavedto,i.e.thetopoftheretrievaltree.Thedefaultis`.'(thecurrentdirectory).2.7HTTPOptions`--default-page=name'Usenameasthedefaultlenamewhenitisn'tknown(i.e.,forURLsthatendinaslash),insteadofindex.html.`-E'`--adjust-extension'Ifaleoftype`application/xhtml+xml'or`text/html'isdownloadedandtheURLdoesnotendwiththeregexp`\.[Hh][Tt][Mm][Ll]?',thisoptionwillcausethesux`.html'tobeappendedtothelocallename.Thisisuseful,forin-stance,whenyou'remirroringaremotesitethatuses`.asp'pages,butyouwantthemirroredpagestobeviewableonyourstockApacheserver.Anothergooduseforthisiswhenyou'redownloadingCGI-generatedmaterials.AURLlike`http://site.com/article.cgi?25'willbesavedasarticle.cgi?25.html.Notethatlenameschangedinthiswaywillbere-downloadedeverytimeyoure-mirrorasite,becauseWgetcan'ttellthatthelocalX.htmllecorrespondstoremoteURL`X'(sinceitdoesn'tyetknowthattheURLproducesoutputoftype`text/html'or`application/xhtml+xml'.Asofversion1.12,Wgetwillalsoensurethatanydownloadedlesoftype`text/css'endinthesux`.css',andtheoptionwasrenamedfrom`--html-extension',tobetterre ectitsnewbehavior.Theoldoptionnameisstillacceptable,butshouldnowbeconsidereddeprecated.Asofversion1.19.2,WgetwillalsoensurethatanydownloadedleswithaContent-Encodingof`br',`compress',`deflate'or`gzip'endinthesux`.br',`.Z',`.zlib'and`.gz'respectively.Atsomepointinthefuture,thisoptionmaywellbeexpandedtoincludesuxesforothertypesofcontent,includingcontenttypesthatarenotparsedbyWget. Chapter2:Invoking16 `--http-user=user'`--http-password=password'Specifytheusernameuserandpasswordpasswordonanhttpserver.Accordingtothetypeofthechallenge,Wgetwillencodethemusingeitherthebasic(insecure),thedigest,ortheWindowsNTLMauthenticationscheme.Anotherwaytospecifyusernameandpasswordisintheurlitself(see Section2.1[URLFormat],page2 ).Eithermethodrevealsyourpasswordtoanyonewhobotherstorunps.Topreventthepasswordsfrombeingseen,usethe`--use-askpass'orstorethemin.wgetrcor.netrc,andmakesuretoprotectthoselesfromotheruserswithchmod.Ifthepasswordsarereallyimportant,donotleavethemlyinginthoseleseither|editthelesanddeletethemafterWgethasstartedthedownload.See Section9.2[SecurityConsiderations],page59 ,formoreinformationaboutse-curityissueswithWget.`--no-http-keep-alive'Turnothe\keep-alive"featureforHTTPdownloads.Normally,Wgetaskstheservertokeeptheconnectionopensothat,whenyoudownloadmorethanonedocumentfromthesameserver,theygettransferredoverthesameTCPconnection.Thissavestimeandatthesametimereducestheloadontheserver.Thisoptionisusefulwhen,forsomereason,persistent(keep-alive)connectionsdon'tworkforyou,forexampleduetoaserverbugorduetotheinabilityofserver-sidescriptstocopewiththeconnections.`--no-cache'Disableserver-sidecache.Inthiscase,Wgetwillsendtheremoteserveranap-propriatedirective(`Pragma:no-cache')togetthelefromtheremoteservice,ratherthanreturningthecachedversion.Thisisespeciallyusefulforretrievingand ushingout-of-datedocumentsonproxyservers.Cachingisallowedbydefault.`--no-cookies'Disabletheuseofcookies.Cookiesareamechanismformaintainingserver-sidestate.TheserversendstheclientacookieusingtheSet-Cookieheader,andtheclientrespondswiththesamecookieuponfurtherrequests.Sincecookiesallowtheserverownerstokeeptrackofvisitorsandforsitestoexchangethisinformation,someconsiderthemabreachofprivacy.Thedefaultistousecookies;however,storingcookiesisnotonbydefault.`--load-cookiesfile'LoadcookiesfromlebeforetherstHTTPretrieval.leisatextualleintheformatoriginallyusedbyNetscape'scookies.txtle.Youwilltypicallyusethisoptionwhenmirroringsitesthatrequirethatyoubeloggedintoaccesssomeoralloftheircontent.Theloginprocesstypicallyworksbythewebserverissuinganhttpcookieuponreceivingandverifyingyourcredentials.Thecookieisthenresentbythebrowserwhenaccessingthatpartofthesite,andsoprovesyouridentity.MirroringsuchasiterequiresWgettosendthesamecookiesyourbrowsersendswhencommunicatingwiththesite.Thisisachievedby`--load-cookies'|simplypointWgettothelocationofthecookies.txtle,anditwillsendthesamecookiesyourbrowserwouldsendinthesamesituation.Dierentbrowserskeeptextualcookielesindierentlocations:Netscape4.x.Thecookiesarein~/.netscape/cookies.txt. Chapter2:Invoking17 MozillaandNetscape6.x.Mozilla'scookieleisalsonamedcookies.txt,locatedsomewhereunder~/.mozilla,inthedirectoryofyourprole.Thefullpathusu-allyendsuplookingsomewhatlike~/.mozilla/default/some-weird-string/cookies.txt.InternetExplorer.YoucanproduceacookieleWgetcanusebyusingtheFilemenu,ImportandExport,ExportCookies.ThishasbeentestedwithInternetExplorer5;itisnotguaranteedtoworkwithearlierversions.Otherbrowsers.Ifyouareusingadierentbrowsertocreateyourcookies,`--load-cookies'willonlyworkifyoucanlocateorproduceacookieleintheNetscapeformatthatWgetexpects.Ifyoucannotuse`--load-cookies',theremightstillbeanalternative.Ifyourbrowsersupportsa\cookiemanager",youcanuseittoviewthecookiesusedwhenaccessingthesiteyou'remirroring.Writedownthenameandvalueofthecookie,andmanuallyinstructWgettosendthosecookies,bypassingthe\ocial"cookiesupport:wget--no-cookies--header"Cookie:name=value"`--save-cookiesfile'Savecookiestolebeforeexiting.Thiswillnotsavecookiesthathaveex-piredorthathavenoexpirytime(so-called\sessioncookies"),butalsosee`--keep-session-cookies'.`--keep-session-cookies'Whenspecied,causes`--save-cookies'toalsosavesessioncookies.Sessioncook-iesarenormallynotsavedbecausetheyaremeanttobekeptinmemoryandfor-gottenwhenyouexitthebrowser.Savingthemisusefulonsitesthatrequireyoutologinortovisitthehomepagebeforeyoucanaccesssomepages.Withthisoption,multipleWgetrunsareconsideredasinglebrowsersessionasfarasthesiteisconcerned.Sincethecookieleformatdoesnotnormallycarrysessioncookies,Wgetmarksthemwithanexpirytimestampof0.Wget's`--load-cookies'recognizesthoseassessioncookies,butitmightconfuseotherbrowsers.Alsonotethatcookiessoloadedwillbetreatedasothersessioncookies,whichmeansthatifyouwant`--save-cookies'topreservethemagain,youmustuse`--keep-session-cookies'again.`--ignore-length'Unfortunately,somehttpservers(cgiprograms,tobemoreprecise)sendoutbogusContent-Lengthheaders,whichmakesWgetgowild,asitthinksnotallthedocumentwasretrieved.YoucanspotthissyndromeifWgetretriesgettingthesamedocumentagainandagain,eachtimeclaimingthatthe(otherwisenormal)connectionhasclosedontheverysamebyte.Withthisoption,WgetwillignoretheContent-Lengthheader|asifitneverex-isted.`--header=header-line'Sendheader-linealongwiththerestoftheheadersineachhttprequest.Thesuppliedheaderissentas-is,whichmeansitmustcontainnameandvalueseparatedbycolon,andmustnotcontainnewlines. Chapter2:Invoking18 Youmaydenemorethanoneadditionalheaderbyspecifying`--header'morethanonce.wget--header='Accept-Charset:iso-8859-2'\--header='Accept-Language:hr'\http://fly.srk.fer.hr/Specicationofanemptystringastheheadervaluewillclearallprevioususer-denedheaders.AsofWget1.10,thisoptioncanbeusedtooverrideheadersotherwisegeneratedautomatically.ThisexampleinstructsWgettoconnecttolocalhost,buttospecify`foo.bar'intheHostheader:wget--header="Host:foo.bar"http://localhost/InversionsofWgetpriorto1.10suchuseof`--header'causedsendingofduplicateheaders.`--compression=type'Choosethetypeofcompressiontobeused.Legalvaluesare`auto',`gzip'and`none'.If`auto'or`gzip'arespecied,Wgetaskstheservertocompresstheleusingthegzipcompressionformat.IftheservercompressestheleandrespondswiththeContent-Encodingheadereldsetappropriately,thelewillbedecompressedautomatically.If`none'isspecied,wgetwillnotasktheservertocompresstheleandwillnotdecompressanyserverresponses.Thisisthedefault.Compressionsupportiscurrentlyexperimental.Incaseitisturnedon,pleasereportanybugstobug-wget@gnu.org.`--max-redirect=number'Speciesthemaximumnumberofredirectionstofollowforaresource.Thedefaultis20,whichisusuallyfarmorethannecessary.However,onthoseoccasionswhereyouwanttoallowmore(orfewer),thisistheoptiontouse.`--proxy-user=user'`--proxy-password=password'Specifytheusernameuserandpasswordpasswordforauthenticationonaproxyserver.Wgetwillencodethemusingthebasicauthenticationscheme.Securityconsiderationssimilartothosewith`--http-password'pertainhereaswell.`--referer=url'Include`Referer:url'headerinHTTPrequest.Usefulforretrievingdocumentswithserver-sideprocessingthatassumetheyarealwaysbeingretrievedbyinteractivewebbrowsersandonlycomeoutproperlywhenRefererissettooneofthepagesthatpointtothem.`--save-headers'Savetheheaderssentbythehttpservertothele,precedingtheactualcontents,withanemptylineastheseparator.`-Uagent-string'`--user-agent=agent-string'Identifyasagent-stringtothehttpserver.ThehttpprotocolallowstheclientstoidentifythemselvesusingaUser-Agentheadereld.Thisenablesdistinguishingthewwwsoftware,usuallyforstatis- Chapter2:Invoking19 ticalpurposesorfortracingofprotocolviolations.Wgetnormallyidentiesas`Wget/version',versionbeingthecurrentversionnumberofWget.However,somesiteshavebeenknowntoimposethepolicyoftailoringtheoutputaccordingtotheUser-Agent-suppliedinformation.Whilethisisnotsuchabadideaintheory,ithasbeenabusedbyserversdenyinginformationtoclientsotherthan(historically)Netscapeor,morefrequently,MicrosoftInternetExplorer.ThisoptionallowsyoutochangetheUser-AgentlineissuedbyWget.Useofthisoptionisdiscouraged,unlessyoureallyknowwhatyouaredoing.Specifyingemptyuseragentwith`--user-agent=""'instructsWgetnottosendtheUser-Agentheaderinhttprequests.`--post-data=string'`--post-file=file'UsePOSTasthemethodforallHTTPrequestsandsendthespecieddataintherequestbody.`--post-data'sendsstringasdata,whereas`--post-file'sendsthecontentsofle.Otherthanthat,theyworkinexactlythesameway.Inparticular,theybothexpectcontentoftheformkey1=value1&key2=value2,withpercent-encodingforspecialcharacters;theonlydierenceisthatoneexpectsitscontentasacommand-lineparameterandtheotheracceptsitscontentfromale.Inparticu-lar,`--post-file'isnotfortransmittinglesasformattachments:thosemustap-pearaskey=valuedata(withappropriatepercent-coding)justlikeeverythingelse.Wgetdoesnotcurrentlysupportmultipart/form-datafortransmittingPOSTdata;onlyapplication/x-www-form-urlencoded.Onlyoneof`--post-data'and`--post-file'shouldbespecied.Pleasenotethatwgetdoesnotrequirethecontenttobeoftheformkey1=value1&key2=value2,andneitherdoesittestforit.Wgetwillsimplytransmitwhateverdataisprovidedtoit.MostservershoweverexpectthePOSTdatatobeintheaboveformatwhenprocessingHTMLForms.WhensendingaPOSTrequestusingthe`--post-file'option,WgettreatstheleasabinaryleandwillsendeverycharacterinthePOSTrequestwithoutstrippingtrailingnewlineorformfeedcharacters.Anyothercontrolcharactersinthetextwillalsobesentas-isinthePOSTrequest.PleasebeawarethatWgetneedstoknowthesizeofthePOSTdatainadvance.Thereforetheargumentto--post-filemustbearegularle;specifyingaFIFOorsomethinglike/dev/stdinwon'twork.It'snotquiteclearhowtoworkaroundthislimitationinherentinHTTP/1.0.AlthoughHTTP/1.1introduceschunkedtransferthatdoesn'trequireknowingtherequestlengthinadvance,aclientcan'tusechunkedunlessitknowsit'stalkingtoanHTTP/1.1server.Anditcan'tknowthatuntilitreceivesaresponse,whichinturnrequirestherequesttohavebeencompleted{achicken-and-eggproblem.Note:Asofversion1.15ifWgetisredirectedafterthePOSTrequestiscompleted,itsbehaviourwilldependontheresponsecodereturnedbytheserver.Incaseofa301MovedPermanently,302MovedTemporarilyor307TemporaryRedirect,Wgetwill,inaccordancewithRFC2616,continuetosendaPOSTrequest.IncaseaserverwantstheclienttochangetheRequestmethoduponredirection,itshouldsenda303SeeOtherresponsecode.ThisexampleshowshowtologintoaserverusingPOSTandthenproceedtodownloadthedesiredpages,presumablyonlyaccessibletoauthorizedusers: Chapter2:Invoking20 #Logintotheserver.Thiscanbedoneonlyonce.wget--save-cookiescookies.txt\--post-data'user=foo&password=bar'\http://example.com/auth.php#Nowgrabthepageorpageswecareabout.wget--load-cookiescookies.txt\-phttp://example.com/interesting/article.phpIftheserverisusingsessioncookiestotrackuserauthentication,theabovewillnotworkbecause`--save-cookies'willnotsavethem(andneitherwillbrowsers)andthecookies.txtlewillbeempty.Inthatcaseuse`--keep-session-cookies'alongwith`--save-cookies'toforcesavingofsessioncookies.`--method=HTTP-Method'ForthepurposeofRESTfulscripting,WgetallowssendingofotherHTTPMethodswithouttheneedtoexplicitlysetthemusing`--header=Header-Line'.Wgetwillusewhateverstringispassedtoitafter`--method'astheHTTPMethodtotheserver.`--body-data=Data-String'`--body-file=Data-File'MustbesetwhenadditionaldataneedstobesenttotheserveralongwiththeMethodspeciedusing`--method'.`--body-data'sendsstringasdata,whereas`--body-file'sendsthecontentsofle.Otherthanthat,theyworkinexactlythesameway.Currently,`--body-file'isnotfortransmittinglesasawhole.Wgetdoesnotcurrentlysupportmultipart/form-datafortransmittingdata;onlyapplication/x-www-form-urlencoded.Inthefuture,thismaybechangedsothatwgetsendsthe`--body-file'asacompleteleinsteadofsendingitscontentstotheserver.PleasebeawarethatWgetneedstoknowthecontentsofBODYDatainadvance,andhencetheargumentto`--body-file'shouldbearegularle.See`--post-file'foramoredetailedexplanation.Onlyoneof`--body-data'and`--body-file'shouldbespecied.IfWgetisredirectedaftertherequestiscompleted,WgetwillsuspendthecurrentmethodandsendaGETrequesttilltheredirectioniscompleted.Thisistrueforallredirectionresponsecodesexcept307TemporaryRedirectwhichisusedtoexplicitlyspecifythattherequestmethodshouldnotchange.AnotherexceptioniswhenthemethodissettoPOST,inwhichcasetheredirectionrulesspeciedunder`--post-data'arefollowed.`--content-disposition'Ifthisissettoon,experimental(notfully-functional)supportforContent-Dispositionheadersisenabled.Thiscancurrentlyresultinextraround-tripstotheserverforaHEADrequest,andisknowntosuerfromafewbugs,whichiswhyitisnotcurrentlyenabledbydefault.Thisoptionisusefulforsomele-downloadingCGIprogramsthatuseContent-Dispositionheaderstodescribewhatthenameofadownloadedleshouldbe.Whencombinedwith`--metalink-over-http'and`--trust-server-names',a`Content-Type:application/metalink4+xml'leisnamedusingtheContent-Dispositionlenameeld,ifavailable. Chapter2:Invoking21 `--content-on-error'Ifthisissettoon,wgetwillnotskipthecontentwhentheserverrespondswithahttpstatuscodethatindicateserror.`--trust-server-names'Ifthisisset,onaredirect,thelocallenamewillbebasedontheredirectionURL.BydefaultthelocallenameisbasedontheoriginalURL.WhendoingrecursiveretrievingthiscanbehelpfulbecauseinmanywebsitesredirectedURLscorrespondtoanunderlyinglestructure,whilelinkURLsdonot.`--auth-no-challenge'Ifthisoptionisgiven,WgetwillsendBasicHTTPauthenticationinformation(plaintextusernameandpassword)forallrequests,justlikeWget1.10.2andpriordidbydefault.Useofthisoptionisnotrecommended,andisintendedonlytosupportsomefewobscureservers,whichneversendHTTPauthenticationchallenges,butacceptun-solicitedauthinfo,say,inadditiontoform-basedauthentication.`--retry-on-host-error'Considerhosterrors,suchas\Temporaryfailureinnameresolution",asnon-fatal,transienterrors.`--retry-on-http-error=code[,code,...]'ConsidergivenHTTPresponsecodesasnon-fatal,transienterrors.Supplyacomma-separatedlistof3-digitHTTPresponsecodesasargument.Usefultoworkaroundspecialcircumstanceswhereretriesarerequired,buttheserverrespondswithanerrorcodenormallynotretriedbyWget.Sucherrorsmightbe503(Ser-viceUnavailable)and429(TooManyRequests).RetriesenabledbythisoptionareperformedsubjecttothenormalretrytimingandretrycountlimitationsofWget.Usingthisoptionisintendedtosupportspecialusecasesonlyandisgenerallynotrecommended,asitcanforceretriesevenincaseswheretheserverisactuallytryingtodecreaseitsload.Pleaseusewiselyandonlyifyouknowwhatyouaredoing.2.8HTTPS(SSL/TLS)OptionsTosupportencryptedHTTP(HTTPS)downloads,WgetmustbecompiledwithanexternalSSLlibrary.ThecurrentdefaultisGnuTLS.Inaddition,WgetalsosupportsHSTS(HTTPStrictTransportSecurity).IfWgetiscompiledwithoutSSLsupport,noneoftheseoptionsareavailable.`--secure-protocol=protocol'Choosethesecureprotocoltobeused.Legalvaluesare`auto',`SSLv2',`SSLv3',`TLSv1',`TLSv1_1',`TLSv1_2',`TLSv1_3'and`PFS'.If`auto'isused,theSSLlibraryisgiventhelibertyofchoosingtheappropriateprotocolautomatically,whichisachievedbysendingaTLSv1greeting.Thisisthedefault.Specifying`SSLv2',`SSLv3',`TLSv1',`TLSv1_1',`TLSv1_2'or`TLSv1_3'forcestheuseofthecorrespondingprotocol.ThisisusefulwhentalkingtooldandbuggySSLserverimplementationsthatmakeithardfortheunderlyingSSLlibrarytochoosethecorrectprotocolversion.Fortunately,suchserversarequiterare.Specifying`PFS'enforcestheuseoftheso-calledPerfectForwardSecurityciphersuites.Inshort,PFSaddssecuritybycreatingaone-timekeyforeachSSLconnec-tion.IthasabitmoreCPUimpactonclientandserver.Weuseknowntobesecureciphers(e.g.noMD4)andtheTLSprotocol.Thismodealsoexplicitlyexcludesnon-PFSkeyexchangemethods,suchasRSA. Chapter2:Invoking22 `--https-only'Wheninrecursivemode,onlyHTTPSlinksarefollowed.`--ciphers'Setthecipherliststring.TypicallythisstringsetstheciphersuitesandotherSSL/TLSoptionsthattheuserwishshouldbeused,inasetorderofpreference(GnuTLScallsit'prioritystring').ThisstringwillbefedverbatimtotheSSL/TLSengine(OpenSSLorGnuTLS)andhenceitsformatandsyntaxisdependantonthat.Wgetwillnotprocessormanipulateitinanyway.RefertotheOpenSSLorGnuTLSdocumentationformoreinformation.`--no-check-certificate'Don'tchecktheservercerticateagainsttheavailablecerticateauthorities.Alsodon'trequiretheURLhostnametomatchthecommonnamepresentedbythecerticate.AsofWget1.10,thedefaultistoverifytheserver'scerticateagainsttherecog-nizedcerticateauthorities,breakingtheSSLhandshakeandabortingthedownloadifthevericationfails.Althoughthisprovidesmoresecuredownloads,itdoesbreakinteroperabilitywithsomesitesthatworkedwithpreviousWgetversions,particu-larlythoseusingself-signed,expired,orotherwiseinvalidcerticates.Thisoptionforcesan\insecure"modeofoperationthatturnsthecerticatevericationerrorsintowarningsandallowsyoutoproceed.Ifyouencounter\certicateverication"errorsoronessayingthat\commonnamedoesn'tmatchrequestedhostname",youcanusethisoptiontobypasstheveri-cationandproceedwiththedownload.Onlyusethisoptionifyouareotherwiseconvincedofthesite'sauthenticity,orifyoureallydon'tcareaboutthevalidityofitscerticate.Itisalmostalwaysabadideanottocheckthecerticateswhentransmittingcondentialorimportantdata.Forself-signed/internalcerticates,youshoulddownloadthecerticateandverifyagainstthatinsteadofforcingthisinsecuremode.Ifyouarereallysureofnotdesiringanycerticateverication,youcanspecify{check-certicate=quiettotellwgettonotprintanywarningaboutinvalidcerticates,albeitinmostcasesthisisthewrongthingtodo.`--certificate=file'Usetheclientcerticatestoredinle.Thisisneededforserversthatareconguredtorequirecerticatesfromtheclientsthatconnecttothem.Normallyacerticateisnotrequiredandthisswitchisoptional.`--certificate-type=type'Specifythetypeoftheclientcerticate.Legalvaluesare`PEM'(assumedbydefault)and`DER',alsoknownas`ASN1'.`--private-key=file'Readtheprivatekeyfromle.Thisallowsyoutoprovidetheprivatekeyinaleseparatefromthecerticate.`--private-key-type=type'Specifythetypeoftheprivatekey.Acceptedvaluesare`PEM'(thedefault)and`DER'.`--ca-certificate=file'Useleasthelewiththebundleofcerticateauthorities(\CA")toverifythepeers.ThecerticatesmustbeinPEMformat.WithoutthisoptionWgetlooksforCAcerticatesatthesystem-speciedlocations,chosenatOpenSSLinstallationtime. Chapter2:Invoking23 `--ca-directory=directory'SpeciesdirectorycontainingCAcerticatesinPEMformat.EachlecontainsoneCAcerticate,andthelenameisbasedonahashvaluederivedfromthecer-ticate.Thisisachievedbyprocessingacerticatedirectorywiththec_rehashutilitysuppliedwithOpenSSL.Using`--ca-directory'ismoreecientthan`--ca-certificate'whenmanycerticatesareinstalledbecauseitallowsWgettofetchcerticatesondemand.WithoutthisoptionWgetlooksforCAcerticatesatthesystem-speciedlocations,chosenatOpenSSLinstallationtime.`--crl-file=file'SpeciesaCRLleinle.ThisisneededforcerticatesthathavebeenrevocatedbytheCAs.`--pinnedpubkey=file/hashes'Tellswgettousethespeciedpublickeyle(orhashes)toverifythepeer.ThiscanbeapathtoalewhichcontainsasinglepublickeyinPEMorDERformat,oranynumberofbase64encodedsha256hashesprecededby\sha256//"andseparatedby\;"WhennegotiatingaTLSorSSLconnection,theserversendsacerticateindicatingitsidentity.Apublickeyisextractedfromthiscerticateandifitdoesnotexactlymatchthepublickey(s)providedtothisoption,wgetwillaborttheconnectionbeforesendingorreceivinganydata.`--random-file=file'[OpenSSLandLibreSSLonly]Useleasthesourceofrandomdataforseedingthepseudo-randomnumbergeneratoronsystemswithout/dev/urandom.OnsuchsystemstheSSLlibraryneedsanexternalsourceofrandomnesstoinitialize.RandomnessmaybeprovidedbyEGD(see`--egd-file'below)orreadfromanexternalsourcespeciedbytheuser.Ifthisoptionisnotspecied,Wgetlooksforrandomdatain$RANDFILEor,ifthatisunset,in$HOME/.rnd.Ifyou'regettingthe\CouldnotseedOpenSSLPRNG;disablingSSL."error,youshouldproviderandomdatausingsomeofthemethodsdescribedabove.`--egd-file=file'[OpenSSLonly]UseleastheEGDsocket.EGDstandsforEntropyGatheringDaemon,auser-spaceprogramthatcollectsdatafromvariousunpredictablesystemsourcesandmakesitavailabletootherprogramsthatmightneedit.Encryptionsoftware,suchastheSSLlibrary,needssourcesofnon-repeatingrandomnesstoseedtherandomnumbergeneratorusedtoproducecryptographicallystrongkeys.OpenSSLallowstheusertospecifyhisownsourceofentropyusingtheRAND_FILEenvironmentvariable.Ifthisvariableisunset,orifthespeciedledoesnotproduceenoughrandomness,OpenSSLwillreadrandomdatafromEGDsocketspeciedusingthisoption.Ifthisoptionisnotspecied(andtheequivalentstartupcommandisnotused),EGDisnevercontacted.EGDisnotneededonmodernUnixsystemsthatsupport/dev/urandom.`--no-hsts'WgetsupportsHSTS(HTTPStrictTransportSecurity,RFC6797)bydefault.Use`--no-hsts'tomakeWgetactasanon-HSTS-compliantUA.Asaconsequence,WgetwouldignorealltheStrict-Transport-Securityheaders,andwouldnotenforceanyexistingHSTSpolicy. Chapter2:Invoking24 `--hsts-file=file'Bydefault,WgetstoresitsHSTSdatabasein~/.wget-hsts.Youcanuse`--hsts-file'tooverridethis.WgetwillusethesuppliedleastheHSTSdata-base.SuchlemustconformtothecorrectHSTSdatabaseformatusedbyWget.IfWgetcannotparsetheprovidedle,thebehaviourisunspecied.TheWget'sHSTSdatabaseisaplaintextle.EachlinecontainsanHSTSentry(ie.asitethathasissuedaStrict-Transport-SecurityheaderandthatthereforehasspeciedaconcreteHSTSpolicytobeapplied).Linesstartingwithadash(#)areignoredbyWget.Pleasenotethatinspiteofthisconvenienthuman-readabilityhand-hackingtheHSTSdatabaseisgenerallynotagoodidea.AnHSTSentrylineconsistsofseveraleldsseparatedbyoneormorewhitespace:host;name;SPport;[SPincl;ude-;㍀subdomainsSPrea;ted0;SPmax-; ge0;ThehostnameandporteldsindicatethehostnameandporttowhichthegivenHSTSpolicyapplies.Theporteldmaybezero,anditwill,inmostofthecases.ThatmeansthattheportnumberwillnotbetakenintoaccountwhendecidingwhethersuchHSTSpolicyshouldbeappliedonagivenrequest(onlythehost-namewillbeevaluated).Whenportisdierenttozero,boththetargethostnameandtheportwillbeevaluatedandtheHSTSpolicywillonlybeappliedifbothofthemmatch.Thisfeaturehasbeenincludedfortesting/developmentpurposesonly.TheWgettestsuite(intestenv/)createsHSTSdatabaseswithexplicitportswiththepurposeofensuringWget'scorrectbehaviour.ApplyingHSTSpoliciestoportsotherthanthedefaultonesisdiscouragedbyRFC6797(seeAppendixB"DierencesbetweenHSTSPolicyandSame-OriginPolicy").Thus,thisfunction-alityshouldnotbeusedinproductionenvironmentsandportwilltypicallybezero.Thelastthreeeldsdowhattheyareexpectedto.Theeldinclude subdomainscaneitherbe1or0anditsignalswhetherthesubdomainsofthetargetdomainshouldbepartofthegivenHSTSpolicyaswell.Thecreatedandmax-ageeldsholdthetimestampvaluesofwhensuchentrywascreated(rstseenbyWget)andtheHSTS-denedvalue'max-age',whichstateshowlongshouldthatHSTSpolicyremainactive,measuredinsecondselapsedsincethetimestampstoredincreated.Oncethattimehaspassed,thatHSTSpolicywillnolongerbevalidandwilleventuallyberemovedfromthedatabase.IfyousupplyyourownHSTSdatabasevia`--hsts-file',beawarethatWgetmaymodifytheprovidedleifanychangeoccursbetweentheHSTSpoliciesrequestedbytheremoteserversandthoseinthele.WhenWgetexists,iteectivelyupdatestheHSTSdatabasebyrewritingthedatabaselewiththenewentries.Ifthesuppliedledoesnotexist,Wgetwillcreateone.ThislewillcontainthenewHSTSentries.IfnoHSTSentriesweregenerated(noStrict-Transport-Securityheadersweresentbyanyoftheservers)thennolewillbecreated,notevenanemptyone.Thisbehaviourappliestothedefaultdatabasele(~/.wget-hsts)aswell:itwillnotbecreateduntilsomeserverenforcesanHSTSpolicy.CareistakennottooverridepossiblechangesmadebyotherWgetprocessesatthesametimeovertheHSTSdatabase.BeforedumpingtheupdatedHSTSentriesonthele,Wgetwillre-readitandmergethechanges.UsingacustomHSTSdatabaseand/ormodifyinganexistingoneisdiscouraged.Formoreinformationaboutthepotentialsecuritythreatsarisedfromsuchpractice,seesection14"SecurityConsiderations"ofRFC6797,speciallysection14.9"CreativeManipulationofHSTSPolicyStore".`--warc-file=file'UseleasthedestinationWARCle. Chapter2:Invoking25 `--warc-header=string'Usestringintoasthewarcinforecord.`--warc-max-size=size'SetthemaximumsizeoftheWARClestosize.`--warc-cdx'WriteCDXindexles.`--warc-dedup=file'DonotstorerecordslistedinthisCDXle.`--no-warc-compression'DonotcompressWARCleswithGZIP.`--no-warc-digests'DonotcalculateSHA1digests.`--no-warc-keep-log'DonotstorethelogleinaWARCrecord.`--warc-tempdir=dir'SpecifythelocationfortemporarylescreatedbytheWARCwriter.2.9FTPOptions`--ftp-user=user'`--ftp-password=password'Specifytheusernameuserandpasswordpasswordonanftpserver.Withoutthis,orthecorrespondingstartupoption,thepassworddefaultsto`-wget@',normallyusedforanonymousFTP.Anotherwaytospecifyusernameandpasswordisintheurlitself(see Section2.1[URLFormat],page2 ).Eithermethodrevealsyourpasswordtoanyonewhobotherstorunps.Topreventthepasswordsfrombeingseen,storethemin.wgetrcor.netrc,andmakesuretoprotectthoselesfromotheruserswithchmod.Ifthepasswordsarereallyimportant,donotleavethemlyinginthoseleseither|editthelesanddeletethemafterWgethasstartedthedownload.See Section9.2[SecurityConsiderations],page59 ,formoreinformationaboutse-curityissueswithWget.`--no-remove-listing'Don'tremovethetemporary.listinglesgeneratedbyftpretrievals.Normally,theselescontaintherawdirectorylistingsreceivedfromftpservers.Notremovingthemcanbeusefulfordebuggingpurposes,orwhenyouwanttobeabletoeasilycheckonthecontentsofremoteserverdirectories(e.g.toverifythatamirroryou'rerunningiscomplete).NotethateventhoughWgetwritestoaknownlenameforthisle,thisisnotasecurityholeinthescenarioofausermaking.listingasymboliclinkto/etc/passwdorsomethingandaskingroottorunWgetinhisorherdirectory.Dependingontheoptionsused,eitherWgetwillrefusetowriteto.listing,mak-ingtheglobbing/recursion/time-stampingoperationfail,orthesymboliclinkwillbedeletedandreplacedwiththeactual.listingle,orthelistingwillbewrittentoa.listing.numberle.Eventhoughthissituationisn'taproblem,though,rootshouldneverrunWgetinanon-trusteduser'sdirectory.Ausercoulddosomethingassimpleaslinking Chapter2:Invoking26 index.htmlto/etc/passwdandaskingroottorunWgetwith`-N'or`-r'sothelewillbeoverwritten.`--no-glob'Turnoftpglobbing.Globbingreferstotheuseofshell-likespecialcharacters(wildcards),like`*',`?',`['and`]'toretrievemorethanonelefromthesamedirectoryatonce,like:wgetftp://gnjilux.srk.fer.hr/*.msgBydefault,globbingwillbeturnedoniftheurlcontainsaglobbingcharacter.Thisoptionmaybeusedtoturnglobbingonoropermanently.Youmayhavetoquotetheurltoprotectitfrombeingexpandedbyyourshell.GlobbingmakesWgetlookforadirectorylisting,whichissystem-specic.ThisiswhyitcurrentlyworksonlywithUnixftpservers(andtheonesemulatingUnixlsoutput).`--no-passive-ftp'DisabletheuseofthepassiveFTPtransfermode.PassiveFTPmandatesthattheclientconnecttotheservertoestablishthedataconnectionratherthantheotherwayaround.IfthemachineisconnectedtotheInternetdirectly,bothpassiveandactiveFTPshouldworkequallywell.BehindmostrewallandNATcongurationspassiveFTPhasabetterchanceofworking.However,insomerarerewallcongurations,activeFTPactuallyworkswhenpassiveFTPdoesn't.Ifyoususpectthistobethecase,usethisoption,orsetpassive_ftp=offinyourinitle.`--preserve-permissions'Preserveremotelepermissionsinsteadofpermissionssetbyumask.`--retr-symlinks'Bydefault,whenretrievingftpdirectoriesrecursivelyandasymboliclinkisencoun-tered,thesymboliclinkistraversedandthepointed-tolesareretrieved.Currently,Wgetdoesnottraversesymboliclinkstodirectoriestodownloadthemrecursively,thoughthisfeaturemaybeaddedinthefuture.When`--retr-symlinks=no'isspecied,thelinked-toleisnotdownloaded.In-stead,amatchingsymboliclinkiscreatedonthelocallesystem.Thepointed-tolewillnotberetrievedunlessthisrecursiveretrievalwouldhaveencountereditseparatelyanddownloadeditanyway.ThisoptionposesasecurityriskwhereamaliciousFTPServermaycauseWgettowritetolesoutsideoftheintendeddirectoriesthroughaspeciallycrafted.listingle.Notethatwhenretrievingale(notadirectory)becauseitwasspeciedonthecommand-line,ratherthanbecauseitwasrecursedto,thisoptionhasnoeect.Symboliclinksarealwaystraversedinthiscase.2.10FTPSOptions`--ftps-implicit'ThisoptiontellsWgettouseFTPSimplicitly.ImplicitFTPSconsistsofinitializingSSL/TLSfromtheverybeginningofthecontrolconnection.ThisoptiondoesnotsendanAUTHTLScommand:itassumestheserverspeaksFTPSanddirectlystartsanSSL/TLSconnection.Iftheattemptissuccessful,thesessioncontinuesjustlikeregularFTPS(PBSZandPROTaresent,etc.).ImplicitFTPSisnolongerarequirementforFTPSimplementations,andthusmanyserversmaynotsupportit.If`--ftps-implicit'ispassedandnoexplicitportnumberspecied,thedefault Chapter2:Invoking27 portforimplicitFTPS,990,willbeused,insteadofthedefaultportforthe"normal"(explicit)FTPSwhichisthesameasthatofFTP,21.`--no-ftps-resume-ssl'DonotresumetheSSL/TLSsessioninthedatachannel.Whenstartingadataconnection,WgettriestoresumetheSSL/TLSsessionpreviouslystartedinthecontrolconnection.SSL/TLSsessionresumptionavoidsperforminganentirelynewhandshakebyreusingtheSSL/TLSparametersofaprevioussession.Typically,theFTPSserverswantitthatway,soWgetdoesthisbydefault.Underrarecircumstanceshowever,onemightwanttostartanentirelynewSSL/TLSsessionineverydataconnection.Thisiswhat`--no-ftps-resume-ssl'isfor.`--ftps-clear-data-connection'Allthedataconnectionswillbeinplaintext.OnlythecontrolconnectionwillbeunderSSL/TLS.WgetwillsendaPROTCcommandtoachievethis,whichmustbeapprovedbytheserver.`--ftps-fallback-to-ftp'FallbacktoFTPifFTPSisnotsupportedbythetargetserver.Forsecurityreasons,thisoptionisnotassertedbydefault.Thedefaultbehaviouristoexitwithanerror.IfaserverdoesnotsuccessfullyreplytotheinitialAUTHTLScommand,orinthecaseofimplicitFTPS,iftheinitialSSL/TLSconnectionattemptisrejected,itisconsideredthatsuchserverdoesnotsupportFTPS.2.11RecursiveRetrievalOptions`-r'`--recursive'Turnonrecursiveretrieving.See Chapter3[RecursiveDownload],page33 ,formoredetails.Thedefaultmaximumdepthis5.`-ldepth'`--level=depth'Specifyrecursionmaximumdepthleveldepth(see Chapter3[RecursiveDownload],page33 ).`--delete-after'ThisoptiontellsWgettodeleteeverysingleleitdownloads,afterhavingdoneso.Itisusefulforpre-fetchingpopularpagesthroughaproxy,e.g.:wget-r-nd--delete-afterhttp://whatever.com/~popular/page/The`-r'optionistoretrieverecursively,and`-nd'tonotcreatedirectories.Notethat`--delete-after'deleteslesonthelocalmachine.Itdoesnotis-suethe`DELE'commandtoremoteFTPsites,forinstance.Alsonotethatwhen`--delete-after'isspecied,`--convert-links'isignored,so`.orig'lesaresimplynotcreatedintherstplace.`-k'`--convert-links'Afterthedownloadiscomplete,convertthelinksinthedocumenttomakethemsuitableforlocalviewing.Thisaectsnotonlythevisiblehyperlinks,butanypartofthedocumentthatlinkstoexternalcontent,suchasembeddedimages,linkstostylesheets,hyperlinkstonon-htmlcontent,etc.Eachlinkwillbechangedinoneofthetwoways:ThelinkstolesthathavebeendownloadedbyWgetwillbechangedtorefertotheletheypointtoasarelativelink. Chapter2:Invoking28 Example:ifthedownloadedle/foo/doc.htmllinksto/bar/img.gif,alsodownloaded,thenthelinkindoc.htmlwillbemodiedtopointto`../bar/img.gif'.Thiskindoftransformationworksreliablyforarbitrarycombinationsofdirectories.ThelinkstolesthathavenotbeendownloadedbyWgetwillbechangedtoincludehostnameandabsolutepathofthelocationtheypointto.Example:ifthedownloadedle/foo/doc.htmllinksto/bar/img.gif(orto../bar/img.gif),thenthelinkindoc.htmlwillbemodiedtopointtohttp://hostname/bar/img.gif.Becauseofthis,localbrowsingworksreliably:ifalinkedlewasdownloaded,thelinkwillrefertoitslocalname;ifitwasnotdownloaded,thelinkwillrefertoitsfullInternetaddressratherthanpresentingabrokenlink.Thefactthattheformerlinksareconvertedtorelativelinksensuresthatyoucanmovethedownloadedhierarchytoanotherdirectory.NotethatonlyattheendofthedownloadcanWgetknowwhichlinkshavebeendownloaded.Becauseofthat,theworkdoneby`-k'willbeperformedattheendofallthedownloads.`--convert-file-only'ThisoptionconvertsonlythelenamepartoftheURLs,leavingtherestoftheURLsuntouched.Thislenamepartissometimesreferredtoasthe"basename",althoughweavoidthattermhereinordernottocauseconfusion.Itworksparticularlywellinconjunctionwith`--adjust-extension',althoughthiscouplingisnotenforced.ItprovesusefultopopulateInternetcacheswithlesdownloadedfromdierenthosts.Example:ifsomelinkpointsto//foo.com/bar.cgi?xyzwith`--adjust-extension'assertedanditslocaldestinationisintendedtobe./foo.com/bar.cgi?xyz.css,thenthelinkwouldbeconvertedto//foo.com/bar.cgi?xyz.css.Notethatonlythelenameparthasbeenmodied.TherestoftheURLhasbeenleftuntouched,includingthenetpath(//)whichwouldotherwisebeprocessedbyWgetandconvertedtotheeectivescheme(ie.http://).`-K'`--backup-converted'Whenconvertingale,backuptheoriginalversionwitha`.orig'sux.Aectsthebehaviorof`-N'(see Section5.2[HTTPTime-StampingInternals],page39 ).`-m'`--mirror'Turnonoptionssuitableformirroring.Thisoptionturnsonrecursionandtime-stamping,setsinniterecursiondepthandkeepsftpdirectorylistings.Itiscur-rentlyequivalentto`-r-N-linf--no-remove-listing'.`-p'`--page-requisites'ThisoptioncausesWgettodownloadallthelesthatarenecessarytoproperlydisplayagivenhtmlpage.Thisincludessuchthingsasinlinedimages,sounds,andreferencedstylesheets.Ordinarily,whendownloadingasinglehtmlpage,anyrequisitedocumentsthatmaybeneededtodisplayitproperlyarenotdownloaded.Using`-r'togetherwith`-l'canhelp,butsinceWgetdoesnotordinarilydistinguishbetweenexternaland Chapter2:Invoking29 inlineddocuments,oneisgenerallyleftwith\leafdocuments"thataremissingtheirrequisites.Forinstance,saydocument1.htmlcontainsanIMG0;tagreferencing1.gifandanꀀtagpointingtoexternaldocument2.html.Saythat2.htmlissimilarbutthatitsimageis2.gifanditlinksto3.html.Saythiscontinuesuptosomearbitrarilyhighnumber.Ifoneexecutesthecommand:wget-r-l2http://site/1.htmlthen1.html,1.gif,2.html,2.gif,and3.htmlwillbedownloaded.Asyoucansee,3.htmliswithoutitsrequisite3.gifbecauseWgetissimplycountingthenumberofhops(upto2)awayfrom1.htmlinordertodeterminewheretostoptherecursion.However,withthiscommand:wget-r-l2-phttp://site/1.htmlalltheabovelesand3.html'srequisite3.gifwillbedownloaded.Similarly,wget-r-l1-phttp://site/1.htmlwillcause1.html,1.gif,2.html,and2.giftobedownloaded.Onemightthinkthat:wget-r-l0-phttp://site/1.htmlwoulddownloadjust1.htmland1.gif,butunfortunatelythisisnotthecase,because`-l0'isequivalentto`-linf'|thatis,inniterecursion.Todownloadasinglehtmlpage(orahandfulofthem,allspeciedonthecommand-lineorina`-i'urlinputle)andits(ortheir)requisites,simplyleaveo`-r'and`-l':wget-phttp://site/1.htmlNotethatWgetwillbehaveasif`-r'hadbeenspecied,butonlythatsinglepageanditsrequisiteswillbedownloaded.Linksfromthatpagetoexternaldocumentswillnotbefollowed.Actually,todownloadasinglepageandallitsrequisites(eveniftheyexistonseparatewebsites),andmakesurethelotdisplaysproperlylocally,thisauthorlikestouseafewoptionsinadditionto`-p':wget-E-H-k-K-phttp://site/documentTonishothistopic,it'sworthknowingthatWget'sideaofanexternaldocumentlinkisanyURLspeciedinanꀀtag,an REA;tag,oraLINK;tagotherthanLINK;-333;REL="stylesheet".`--strict-comments'Turnonstrictparsingofhtmlcomments.Thedefaultistoterminatecommentsattherstoccurrenceof`LINK;-333;--'.Accordingtospecications,htmlcommentsareexpressedassgmldeclarations.Declarationisspecialmarkupthatbeginswith`'andendswith`!]TJ;/F55; 10.;邑 Tf ;.4;U 0; Td ;[000;',suchas`!DOC;TYPE;-333;...',thatmaycontaincommentsbetweenapairof`--'delimiters.htmlcommentsare\emptydeclarations",sgmldeclarationswithoutanynon-commenttext.Therefore,`!--f;oo--;'isavalidcomment,andsois`!--o;ne--;]TJ ;-344;.398; -13;.151; Td ;[000;--two--',but`!--1;--2-;-000;'isnot.Ontheotherhand,mosthtmlwritersdon'tperceivecommentsasanythingotherthantextdelimitedwith`'and`!--];TJ/F;U 1;.90; T; 22;.909; 0 T; [0;--',whichisnotquitethesame.Forexample,somethinglike`!---;----;----;-000;'worksasavalidcommentaslongasthenumberofdashesisamultipleoffour(!).Ifnot,thecommenttechnicallylastsuntilthenext`--',whichmaybeattheotherendofthedocument.Becauseofthis,manypopularbrowserscompletelyignorethespecicationandimplementwhatusershavecometoexpect:commentsdelimitedwith`'and`!--];TJ/F;U 1;.90; T; 22;.908; 0 T; [0;--'. Chapter2:Invoking30 Untilversion1.9,Wgetinterpretedcommentsstrictly,whichresultedinmissinglinksinmanywebpagesthatdisplayedneinbrowsers,buthadthemisfortuneofcontainingnon-compliantcomments.Beginningwithversion1.9,Wgethasjoinedtheranksofclientsthatimplements\naive"comments,terminatingeachcommentattherstoccurrenceof`--'.If,forwhateverreason,youwantstrictcommentparsing,usethisoptiontoturniton.2.12RecursiveAccept/RejectOptions`-Aacclist--acceptacclist'`-Rrejlist--rejectrejlist'Specifycomma-separatedlistsoflenamesuxesorpatternstoacceptorreject(see Section4.2[TypesofFiles],page34 ).Notethatifanyofthewildcardcharacters,`*',`?',`['or`]',appearinanelementofacclistorrejlist,itwillbetreatedasapattern,ratherthanasux.Inthiscase,youhavetoenclosethepatternintoquotestopreventyourshellfromexpandingit,likein`-A"*.mp3"'or`-A'*.mp3''.`--accept-regexurlregex'`--reject-regexurlregex'SpecifyaregularexpressiontoacceptorrejectthecompleteURL.`--regex-typeregextype'Specifytheregularexpressiontype.Possibletypesare`posix'or`pcre'.Notethattobeabletouse`pcre'type,wgethastobecompiledwithlibpcresupport.`-Ddomain-list'`--domains=domain-list'Setdomainstobefollowed.domain-listisacomma-separatedlistofdomains.Notethatitdoesnotturnon`-H'.`--exclude-domainsdomain-list'Specifythedomainsthatarenottobefollowed(see Section4.1[SpanningHosts],page34 ).`--follow-ftp'Followftplinksfromhtmldocuments.Withoutthisoption,Wgetwillignorealltheftplinks.`--follow-tags=list'Wgethasaninternaltableofhtmltag/attributepairsthatitconsiderswhenlookingforlinkeddocumentsduringarecursiveretrieval.Ifauserwantsonlyasubsetofthosetagstobeconsidered,however,heorsheshouldbespecifysuchtagsinacomma-separatedlistwiththisoption.`--ignore-tags=list'Thisistheoppositeofthe`--follow-tags'option.Toskipcertainhtmltagswhenrecursivelylookingfordocumentstodownload,specifytheminacomma-separatedlist.Inthepast,thisoptionwasthebestbetfordownloadingasinglepageanditsrequisites,usingacommand-linelike:wget--ignore-tags=a,area-H-k-K-rhttp://site/documentHowever,theauthorofthisoptioncameacrossapagewithtagslikeREL="home"LINK;]TJ ;-367;.307; -13;.151; Td ;[000;HREF="/"andcametotherealizationthatspecifyingtagstoignorewasnotenough.Onecan'tjusttellWgettoignoreLINK;,becausethenstylesheets Chapter2:Invoking31 willnotbedownloaded.Nowthebestbetfordownloadingasinglepageanditsrequisitesisthededicated`--page-requisites'option.`--ignore-case'Ignorecasewhenmatchinglesanddirectories.Thisin uencesthebehaviorof-R,-A,-I,and-Xoptions,aswellasglobbingimplementedwhendownloadingfromFTPsites.Forexample,withthisoption,`-A"*.txt"'willmatch`file1.txt',butalso`file2.TXT',`file3.TxT',andsoon.Thequotesintheexamplearetopreventtheshellfromexpandingthepattern.`-H'`--span-hosts'Enablespanningacrosshostswhendoingrecursiveretrieving(see Section4.1[Span-ningHosts],page34 ).`-L'`--relative'Followrelativelinksonly.Usefulforretrievingaspecichomepagewithoutanydistractions,noteventhosefromthesamehosts(see Section4.4[RelativeLinks],page37 ).`-Ilist'`--include-directories=list'Specifyacomma-separatedlistofdirectoriesyouwishtofollowwhendownloading(see Section4.3[Directory-BasedLimits],page36 ).Elementsoflistmaycontainwildcards.`-Xlist'`--exclude-directories=list'Specifyacomma-separatedlistofdirectoriesyouwishtoexcludefromdownload(see Section4.3[Directory-BasedLimits],page36 ).Elementsoflistmaycontainwildcards.`-np'`--no-parent'Donoteverascendtotheparentdirectorywhenretrievingrecursively.Thisisausefuloption,sinceitguaranteesthatonlythelesbelowacertainhierarchywillbedownloaded.See Section4.3[Directory-BasedLimits],page36 ,formoredetails.2.13ExitStatusWgetmayreturnoneofseveralerrorcodesifitencountersproblems.0Noproblemsoccurred.1Genericerrorcode.2Parseerror|forinstance,whenparsingcommand-lineoptions,the`.wgetrc'or`.netrc'...3FileI/Oerror.4Networkfailure.5SSLvericationfailure.6Username/passwordauthenticationfailure.7Protocolerrors. 32 8Serverissuedanerrorresponse.Withtheexceptionsof0and1,thelower-numberedexitcodestakeprecedenceoverhigher-numberedones,whenmultipletypesoferrorsareencountered.InversionsofWgetpriorto1.12,Wget'sexitstatustendedtobeunhelpfulandincon-sistent.Recursivedownloadswouldvirtuallyalwaysreturn0(success),regardlessofanyis-suesencountered,andnon-recursivefetchesonlyreturnedthestatuscorrespondingtothemostrecently-attempteddownload. 33 3RecursiveDownloadGNUWgetiscapableoftraversingpartsoftheWeb(orasinglehttporftpserver),followinglinksanddirectorystructure.Werefertothisastorecursiveretrieval,orrecursion.Withhttpurls,Wgetretrievesandparsesthehtmlorcssfromthegivenurl,retrievingthelesthedocumentrefersto,throughmarkuplikehreforsrc,orcssurivaluesspeciedusingthe`url()'functionalnotation.Ifthefreshlydownloadedleisalsooftypetext/html,application/xhtml+xml,ortext/css,itwillbeparsedandfollowedfurther.Recursiveretrievalofhttpandhtml/csscontentisbreadth-rst.ThismeansthatWgetrstdownloadstherequesteddocument,thenthedocumentslinkedfromthatdocument,thenthedocumentslinkedbythem,andsoon.Inotherwords,Wgetrstdownloadsthedocumentsatdepth1,thenthoseatdepth2,andsoonuntilthespeciedmaximumdepth.Themaximumdepthtowhichtheretrievalmaydescendisspeciedwiththe`-l'option.Thedefaultmaximumdepthisvelayers.Whenretrievinganftpurlrecursively,Wgetwillretrieveallthedatafromthegivendirectorytree(includingthesubdirectoriesuptothespecieddepth)ontheremoteserver,creatingitsmirrorimagelocally.ftpretrievalisalsolimitedbythedepthparameter.Unlikehttprecursion,ftprecursionisperformeddepth-rst.Bydefault,Wgetwillcreatealocaldirectorytree,correspondingtotheonefoundontheremoteserver.Recursiveretrievingcanndanumberofapplications,themostimportantofwhichismir-roring.Itisalsousefulforwwwpresentations,andanyotheropportunitieswhereslownetworkconnectionsshouldbebypassedbystoringtheleslocally.Youshouldbewarnedthatrecursivedownloadscanoverloadtheremoteservers.Becauseofthat,manyadministratorsfrownuponthemandmaybanaccessfromyoursiteiftheydetectveryfastdownloadsofbigamountsofcontent.WhendownloadingfromInternetservers,considerusingthe`-w'optiontointroduceadelaybetweenaccessestotheserver.Thedownloadwilltakeawhilelonger,buttheserveradministratorwillnotbealarmedbyyourrudeness.Ofcourse,recursivedownloadmaycauseproblemsonyourmachine.Iflefttorununchecked,itcaneasilyllupthedisk.Ifdownloadingfromlocalnetwork,itcanalsotakebandwidthonthesystem,aswellasconsumememoryandCPU.Trytospecifythecriteriathatmatchthekindofdownloadyouaretryingtoachieve.Ifyouwanttodownloadonlyonepage,use`--page-requisites'withoutanyadditionalrecursion.Ifyouwanttodownloadthingsunderonedirectory,use`-np'toavoiddownloadingthingsfromotherdirectories.Ifyouwanttodownloadallthelesfromonedirectory,use`-l1'tomakesuretherecursiondepthneverexceedsone.See Chapter4[FollowingLinks],page34 ,formoreinformationaboutthis.Recursiveretrievalshouldbeusedwithcare.Don'tsayyouwerenotwarned. 34 4FollowingLinksWhenretrievingrecursively,onedoesnotwishtoretrieveloadsofunnecessarydata.Mostofthetimetheusersbearinmindexactlywhattheywanttodownload,andwantWgettofollowonlyspeciclinks.Forexample,ifyouwishtodownloadthemusicarchivefrom`fly.srk.fer.hr',youwillnotwanttodownloadallthehomepagesthathappentobereferencedbyanobscurepartofthearchive.Wgetpossessesseveralmechanismsthatallowsyoutone-tunewhichlinksitwillfollow.4.1SpanningHostsWget'srecursiveretrievalnormallyrefusestovisithostsdierentthantheoneyouspeciedonthecommandline.Thisisareasonabledefault;withoutit,everyretrievalwouldhavethepotentialtoturnyourWgetintoasmallversionofgoogle.However,visitingdierenthosts,orhostspanning,issometimesausefuloption.Maybetheimagesareservedfromadierentserver.Maybeyou'remirroringasitethatconsistsofpagesinterlinkedbetweenthreeservers.Maybetheserverhastwoequivalentnames,andthehtmlpagesrefertobothinterchangeably.Spantoanyhost|`-H'The`-H'optionturnsonhostspanning,thusallowingWget'srecursiveruntovisitanyhostreferencedbyalink.Unlesssucientrecursion-limitingcriteriaareapplieddepth,theseforeignhostswilltypicallylinktoyetmorehosts,andsoonuntilWgetendsupsuckingupmuchmoredatathanyouhaveintended.Limitspanningtocertaindomains|`-D'The`-D'optionallowsyoutospecifythedomainsthatwillbefollowed,thuslimitingtherecursiononlytothehoststhatbelongtothesedomains.Obvi-ously,thismakessenseonlyinconjunctionwith`-H'.Atypicalexamplewouldbedownloadingthecontentsof`www.example.com',butallowingdownloadsfrom`images.example.com',etc.:wget-rH-Dexample.comhttp://www.example.com/Youcanspecifymorethanoneaddressbyseparatingthemwithacomma,e.g.`-Ddomain1.com,domain2.com'.Keepdownloadocertaindomains|`--exclude-domains'Iftherearedomainsyouwanttoexcludespecically,youcandoitwith`--exclude-domains',whichacceptsthesametypeofargumentsof`-D',butwillexcludeallthelisteddomains.Forexample,ifyouwanttodownloadallthehostsfrom`foo.edu'domain,withtheexceptionof`sunsite.foo.edu',youcandoitlikethis:wget-rH-Dfoo.edu--exclude-domainssunsite.foo.edu\http://www.foo.edu/4.2TypesofFilesWhendownloadingmaterialfromtheweb,youwilloftenwanttorestricttheretrievaltoonlycertainletypes.Forexample,ifyouareinterestedindownloadinggifs,youwillnotbeoverjoyedtogetloadsofPostScriptdocuments,andviceversa.Wgetoerstwooptionstodealwiththisproblem.Eachoptiondescriptionlistsashortname,alongname,andtheequivalentcommandin.wgetrc. Chapter4:FollowingLinks35 `-Aacclist'`--acceptacclist'`accept=acclist'`--accept-regexurlregex'`accept-regex=urlregex'Theargumentto`--accept'optionisalistoflesuxesorpatternsthatWgetwilldownloadduringrecursiveretrieval.Asuxistheendingpartofale,andconsistsof\normal"letters,e.g.`gif'or`.jpg'.Amatchingpatterncontainsshell-likewildcards,e.g.`books*'or`zelazny*196[0-9]*'.So,specifying`wget-Agif,jpg'willmakeWgetdownloadonlythelesend-ingwith`gif'or`jpg',i.e.gifsandjpegs.Ontheotherhand,`wget-A"zelazny*196[0-9]*"'willdownloadonlylesbeginningwith`zelazny'andcon-tainingnumbersfrom1960to1969anywherewithin.Lookupthemanualofyourshellforadescriptionofhowpatternmatchingworks.Ofcourse,anynumberofsuxesandpatternscanbecombinedintoacomma-separatedlist,andgivenasanargumentto`-A'.Theargumentto`--accept-regex'optionisaregularexpressionwhichismatchedagainstthecompleteURL.`-Rrejlist'`--rejectrejlist'`reject=rejlist'`--reject-regexurlregex'`reject-regex=urlregex'The`--reject'optionworksthesamewayas`--accept',onlyitslogicisthere-verse;Wgetwilldownloadalllesexcepttheonesmatchingthesuxes(orpatterns)inthelist.So,ifyouwanttodownloadawholepageexceptforthecumbersomempegsand.aules,youcanuse`wget-Rmpg,mpeg,au'.Analogously,todownloadalllesexcepttheonesbeginningwith`bjork',use`wget-R"bjork*"'.Thequotesaretopreventexpansionbytheshell.Theargumentto`--accept-regex'optionisaregularexpressionwhichismatchedagainstthecompleteURL.The`-A'and`-R'optionsmaybecombinedtoachieveevenbetterne-tuningofwhichlestoretrieve.E.g.`wget-A"*zelazny*"-R.ps'willdownloadalltheleshaving`zelazny'asapartoftheirname,butnotthePostScriptles.Notethatthesetwooptionsdonotaectthedownloadingofhtmlles(asdeterminedbya`.htm'or`.html'lenameprex).Thisbehaviormaynotbedesirableforallusers,andmaybechangedforfutureversionsofWget.Note,too,thatquerystrings(stringsattheendofaURLbeginningwithaquestionmark(`?')arenotincludedaspartofthelenameforaccept/rejectrules,eventhoughthesewillactuallycontributetothenamechosenforthelocalle.ItisexpectedthatafutureversionofWgetwillprovideanoptiontoallowmatchingagainstquerystrings.Finally,it'sworthnotingthattheaccept/rejectlistsarematchedtwiceagainstdownloadedles:onceagainsttheURL'slenameportion,todetermineiftheleshouldbedownloadedintherstplace;then,afterithasbeenacceptedandsuccessfullydownloaded,thelocalle'snameisalsocheckedagainsttheaccept/rejectliststoseeifitshouldberemoved.Therationalewasthat,since`.htm'and`.html'lesarealwaysdownloadedregardlessofaccept/rejectrules,theyshouldberemovedafterbeingdownloadedandscannedforlinks,iftheydidmatchtheaccept/rejectlists.However,thiscanleadtounexpectedresults,sincethelocallenamescan Chapter4:FollowingLinks36 dierfromtheoriginalURLlenamesinthefollowingways,allofwhichcanchangewhetheranaccept/rejectrulematches:Ifthelocallealreadyexistsand`--no-directories'wasspecied,anumericsuxwillbeappendedtotheoriginalname.If`--adjust-extension'wasspecied,thelocallenamemighthave`.html'appendedtoit.IfWgetisinvokedwith`-E-A.php',alenamesuchas`index.php'willmatchbeaccepted,butupondownloadwillbenamed`index.php.html',whichnolongermatches,andsothelewillbedeleted.QuerystringsdonotcontributetoURLmatching,butareincludedinlocallenames,andsodocontributetolenamematching.Thisbehavior,too,isconsideredless-than-desirable,andmaychangeinafutureversionofWget.4.3Directory-BasedLimitsRegardlessofotherlink-followingfacilities,itisoftenusefultoplacetherestrictionofwhatlestoretrievebasedonthedirectoriesthoselesareplacedin.Therecanbemanyreasonsforthis|thehomepagesmaybeorganizedinareasonabledirectorystructure;orsomedirectoriesmaycontainuselessinformation,e.g./cgi-binor/devdirectories.Wgetoersthreedierentoptionstodealwiththisrequirement.Eachoptiondescriptionlistsashortname,alongname,andtheequivalentcommandin.wgetrc.`-Ilist'`--includelist'`include_directories=list'`-I'optionacceptsacomma-separatedlistofdirectoriesincludedintheretrieval.Anyotherdirectorieswillsimplybeignored.Thedirectoriesareabsolutepaths.So,ifyouwishtodownloadfrom`http://host/people/bozo/'followingonlylinkstobozo'scolleaguesinthe/peopledirectoryandthebogusscriptsin/cgi-bin,youcanspecify:wget-I/people,/cgi-binhttp://host/people/bozo/`-Xlist'`--excludelist'`exclude_directories=list'`-X'optionisexactlythereverseof`-I'|thisisalistofdirectoriesexcludedfromthedownload.E.g.ifyoudonotwantWgettodownloadthingsfrom/cgi-bindirectory,specify`-X/cgi-bin'onthecommandline.Thesameaswith`-A'/`-R',thesetwooptionscanbecombinedtogetabetterne-tuningofdownloadingsubdirectories.E.g.ifyouwanttoloadallthelesfrom/pubhierarchyexceptfor/pub/worthless,specify`-I/pub-X/pub/worthless'.`-np'`--no-parent'`no_parent=on'Thesimplest,andoftenveryusefulwayoflimitingdirectoriesisdisallowingretrievalofthelinksthatrefertothehierarchyabovethanthebeginningdirectory,i.e.disallowingascenttotheparentdirectory/directories.The`--no-parent'option(short`-np')isusefulinthiscase.Usingitguaranteesthatyouwillneverleavetheexistinghierarchy.SupposingyouissueWgetwith:wget-r--no-parenthttp://somehost/~luzer/my-archive/ Chapter4:FollowingLinks37 Youmayrestassuredthatnoneofthereferencesto/~his-girls-homepage/or/~luzer/all-my-mpegs/willbefollowed.Onlythearchiveyouareinterestedinwillbedownloaded.Essentially,`--no-parent'issimilarto`-I/~luzer/my-archive',onlyithandlesredirectionsinamoreintelligentfashion.Notethat,forHTTP(andHTTPS),thetrailingslashisveryimportantto`--no-parent'.HTTPhasnoconceptofa\directory"|Wgetreliesonyoutoindicatewhat'sadirectoryandwhatisn't.In`http://foo/bar/',Wgetwillcon-sider`bar'tobeadirectory,whilein`http://foo/bar'(notrailingslash),`bar'willbeconsideredalename(so`--no-parent'wouldbemeaningless,asitsparentis`/').4.4RelativeLinksWhen`-L'isturnedon,onlytherelativelinksareeverfollowed.Relativelinksareheredenedthosethatdonotrefertothewebserverroot.Forexample,theselinksarerelative: -52;倀href="foo.gif" -52;倀href="foo/bar.gif" -52;倀href="../foo/bar.gif"Theselinksarenotrelative: -52;倀href="/foo.gif" -52;倀href="/foo/bar.gif" -52;倀href="http://www.example.com/foo/bar.gif"Usingthisoptionguaranteesthatrecursiveretrievalwillnotspanhosts,evenwithout`-H'.Insimplecasesitalsoallowsdownloadsto\justwork"withouthavingtoconvertlinks.Thisoptionisprobablynotveryusefulandmightberemovedinafuturerelease.4.5FollowingFTPLinksTherulesforftparesomewhatspecic,asitisnecessaryforthemtobe.ftplinksinhtmldocumentsareoftenincludedforpurposesofreference,anditisofteninconvenienttodownloadthembydefault.Tohaveftplinksfollowedfromhtmldocuments,youneedtospecifythe`--follow-ftp'option.Havingdonethat,ftplinkswillspanhostsregardlessof`-H'setting.Thisislogical,asftplinksrarelypointtothesamehostwherethehttpserverresides.Forsimilarreasons,the`-L'optionshasnoeectonsuchdownloads.Ontheotherhand,domainacceptance(`-D')andsuxrules(`-A'and`-R')applynormally.Alsonotethatfollowedlinkstoftpdirectorieswillnotberetrievedrecursivelyfurther. 38 5Time-StampingOneofthemostimportantaspectsofmirroringinformationfromtheInternetisupdatingyourarchives.Downloadingthewholearchiveagainandagain,justtoreplaceafewchangedlesisexpen-sive,bothintermsofwastedbandwidthandmoney,andthetimetodotheupdate.Thisiswhyallthemirroringtoolsoertheoptionofincrementalupdating.Suchanupdatingmechanismmeansthattheremoteserverisscannedinsearchofnewles.Onlythosenewleswillbedownloadedintheplaceoftheoldones.Aleisconsiderednewifoneofthesetwoconditionsaremet:1.Aleofthatnamedoesnotalreadyexistlocally.2.Aleofthatnamedoesexist,buttheremotelewasmodiedmorerecentlythanthelocalle.Toimplementthis,theprogramneedstobeawareofthetimeoflastmodicationofbothlocalandremoteles.Wecallthisinformationthetime-stampofale.Thetime-stampinginGNUWgetisturnedonusing`--timestamping'(`-N')option,orthroughtimestamping=ondirectivein.wgetrc.Withthisoption,foreachleitintendstodownload,Wgetwillcheckwhetheralocalleofthesamenameexists.Ifitdoes,andtheremoteleisnotnewer,Wgetwillnotdownloadit.Ifthelocalledoesnotexist,orthesizesofthelesdonotmatch,Wgetwilldownloadtheremotelenomatterwhatthetime-stampssay.5.1Time-StampingUsageTheusageoftime-stampingissimple.Sayyouwouldliketodownloadalesothatitkeepsitsdateofmodication.wget-Shttp://www.gnu.ai.mit.edu/Asimplels-lshowsthatthetimestamponthelocalleequalsthestateoftheLast-Modifiedheader,asreturnedbytheserver.Asyoucansee,thetime-stampinginfoispreservedlocally,evenwithout`-N'(atleastforhttp).Severaldayslater,youwouldlikeWgettocheckiftheremotelehaschanged,anddownloaditifithas.wget-Nhttp://www.gnu.ai.mit.edu/Wgetwillasktheserverforthelast-modieddate.Ifthelocallehasthesametimestampastheserver,oranewerone,theremotelewillnotbere-fetched.However,iftheremoteleismorerecent,Wgetwillproceedtofetchit.Thesamegoesforftp.Forexample:wget"ftp://ftp.ifi.uio.no/pub/emacs/gnus/*"(ThequotesaroundthatURLaretopreventtheshellfromtryingtointerpretthe`*'.)Afterdownload,alocaldirectorylistingwillshowthatthetimestampsmatchthoseontheremoteserver.Reissuingthecommandwith`-N'willmakeWgetre-fetchonlythelesthathavebeenmodiedsincethelastdownload.IfyouwishedtomirrortheGNUarchiveeveryweek,youwoulduseacommandlikethefollowing,weekly:wget--timestamping-rftp://ftp.gnu.org/pub/gnu/Notethattime-stampingwillonlyworkforlesforwhichtheservergivesatimestamp.Forhttp,thisdependsongettingaLast-Modifiedheader.Forftp,thisdependsongettingadirectorylistingwithdatesinaformatthatWgetcanparse(see Section5.3[FTPTime-StampingInternals],page39 ). Chapter5:Time-Stamping39 5.2HTTPTime-StampingInternalsTime-stampinginhttpisimplementedbycheckingoftheLast-Modifiedheader.Ifyouwishtoretrievethelefoo.htmlthroughhttp,Wgetwillcheckwhetherfoo.htmlexistslocally.Ifitdoesn't,foo.htmlwillberetrievedunconditionally.Iftheledoesexistlocally,Wgetwillrstcheckitslocaltime-stamp(similartothewayls-lchecksit),andthensendaHEADrequesttotheremoteserver,demandingtheinformationontheremotele.TheLast-Modifiedheaderisexaminedtondwhichlewasmodiedmorerecently(whichmakesit\newer").Iftheremoteleisnewer,itwillbedownloaded;ifitisolder,Wgetwillgiveup.1When`--backup-converted'(`-K')isspeciedinconjunctionwith`-N',serverle`X'iscomparedtolocalle`X.orig',ifextant,ratherthanbeingcomparedtolocalle`X',whichwillalwaysdierifit'sbeenconvertedby`--convert-links'(`-k').Arguably,httptime-stampingshouldbeimplementedusingtheIf-Modified-Sincere-quest.5.3FTPTime-StampingInternalsIntheory,ftptime-stampingworksmuchthesameashttp,onlyftphasnoheaders|time-stampsmustbeferretedoutofdirectorylistings.Ifanftpdownloadisrecursiveorusesglobbing,WgetwillusetheftpLISTcommandtogetalelistingforthedirectorycontainingthedesiredle(s).Itwilltrytoanalyzethelisting,treatingitlikeUnixls-loutput,extractingthetime-stamps.Therestisexactlythesameasforhttp.Notethatwhenretrievingindividuallesfromanftpserverwithoutusingglobbingorrecursion,listingleswillnotbedownloaded(andthusleswillnotbetime-stamped)unless`-N'isspecied.AssumptionthateverydirectorylistingisaUnix-stylelistingmaysoundextremelycon-straining,butinpracticeitisnot,asmanynon-UnixftpserversusetheUnixoidlistingformatbecausemost(all?)oftheclientsunderstandit.Bearinmindthatrfc959denesnostandardwaytogetalelist,letalonethetime-stamps.Wecanonlyhopethatafuturestandardwilldenethis.Anothernon-standardsolutionincludestheuseofMDTMcommandthatissupportedbysomeftpservers(includingthepopularwu-ftpd),whichreturnstheexacttimeofthespeciedle.Wgetmaysupportthiscommandinthefuture. 1Asanadditionalcheck,WgetwilllookattheContent-Lengthheader,andcomparethesizes;iftheyarenotthesame,theremotelewillbedownloadednomatterwhatthetime-stampsays. 40 6StartupFileOnceyouknowhowtochangedefaultsettingsofWgetthroughcommandlinearguments,youmaywishtomakesomeofthosesettingspermanent.YoucandothatinaconvenientwaybycreatingtheWgetstartuple|.wgetrc.Besides.wgetrcisthe\main"initializationle,itisconvenienttohaveaspecialfacilityforstoringpasswords.ThusWgetreadsandinterpretsthecontentsof$HOME/.netrc,ifitndsit.Youcannd.netrcformatinyoursystemmanuals.Wgetreads.wgetrcuponstartup,recognizingalimitedsetofcommands.6.1WgetrcLocationWheninitializing,Wgetwilllookforaglobalstartuple,/usr/local/etc/wgetrcbydefault(orsomeprexotherthan/usr/local,ifWgetwasnotinstalledthere)andreadcommandsfromthere,ifitexists.Thenitwilllookfortheuser'sle.IftheenvironmentalvariableWGETRCisset,Wgetwilltrytoloadthatle.Failingthat,nofurtherattemptswillbemade.IfWGETRCisnotset,Wgetwilltrytoload$HOME/.wgetrc.Thefactthatuser'ssettingsareloadedafterthesystem-wideonesmeansthatincaseofcol-lisionuser'swgetrcoverridesthesystem-widewgetrc(in/usr/local/etc/wgetrcbydefault).Fascistadmins,away!6.2WgetrcSyntaxThesyntaxofawgetrccommandissimple:variable=valueThevariablewillalsobecalledcommand.Validvaluesaredierentfordierentcommands.Thecommandsarecase-,underscore-andminus-insensitive.Thus`DIr__PrefiX',`DIr-PrefiX'and`dirprefix'arethesame.Emptylines,linesbeginningwith`#'andlinescontainingwhite-spaceonlyarediscarded.Commandsthatexpectacomma-separatedlistwillclearthelistonanemptycommand.So,ifyouwishtoresettherejectionlistspeciedinglobalwgetrc,youcandoitwith:reject=6.3WgetrcCommandsThecompletesetofcommandsislistedbelow.Legalvaluesarelistedafterthe`='.SimpleBooleanvaluescanbesetorunsetusing`on'and`off'or`1'and`0'.Somecommandstakepseudo-arbitraryvalues.addressvaluescanbehostnamesordotted-quadIPaddresses.ncanbeanypositiveinteger,or`inf'forinnity,whereappropriate.stringvaluescanbeanynon-emptystring.Mostofthesecommandshavedirectcommand-lineequivalents.Also,anywgetrccommandcanbespeciedonthecommandlineusingthe`--execute'switch(see Section2.3[BasicStartupOptions],page3 .)accept/reject=stringSameas`-A'/`-R'(see Section4.2[TypesofFiles],page34 ).add hostdir=on/oEnable/disablehost-prexedlenames.`-nH'disablesit. Chapter6:StartupFile41 ask password=on/oPromptforapasswordforeachconnectionestablished.Cannotbespeciedwhen`--password'isbeingused,becausetheyaremutuallyexclusive.Equivalentto`--ask-password'.auth no challenge=on/oIfthisoptionisgiven,WgetwillsendBasicHTTPauthenticationinformation(plaintextusernameandpassword)forallrequests.See`--auth-no-challenge'.background=on/oEnable/disablegoingtobackground|thesameas`-b'(whichenablesit).backup converted=on/oEnable/disablesavingpre-convertedleswiththesux`.orig'|thesameas`-K'(whichenablesit).backups=numberUseuptonumberbackupsforale.Backupsarerotatedbyaddinganincrementalcounterthatstartsat`1'.Thedefaultis`0'.base=stringConsiderrelativeurlsininputles(speciedviathe`input'commandorthe`--input-file'/`-i'option,togetherwith`force_html'or`--force-html')asbe-ingrelativetostring|thesameas`--base=string'.bind address=addressBindtoaddress,likethe`--bind-address=address'.ca certicate=leSetthecerticateauthoritybundleletole.Thesameas`--ca-certificate=file'.ca directory=directorySetthedirectoryusedforcerticateauthorities.Thesameas`--ca-directory=directory'.cache=on/oWhensettoo,disallowserver-caching.Seethe`--no-cache'option.certicate=leSettheclientcerticatelenametole.Thesameas`--certificate=file'.certicate type=stringSpecifythetypeoftheclientcerticate,legalvaluesbeing`PEM'(thedefault)and`DER'(akaASN1).Thesameas`--certificate-type=string'.check certicate=on/oIfthisissettoo,theservercerticateisnotcheckedagainstthespeciedclientauthorities.Thedefaultis\on".Thesameas`--check-certificate'.connect timeout=nSettheconnecttimeout|thesameas`--connect-timeout'.content disposition=on/oTurnonrecognitionofthe(non-standard)`Content-Disposition'HTTPheader|ifsetto`on',thesameas`--content-disposition'.trust server names=on/oIfsettoon,constructthelocallenamefromredirectionURLsratherthanoriginalURLs. Chapter6:StartupFile42 continue=on/oIfsettoon,forcecontinuationofpreexistentpartiallyretrievedles.See`-c'beforesettingit.convert links=on/oConvertnon-relativelinkslocally.Thesameas`-k'.cookies=on/oWhensettoo,disallowcookies.Seethe`--cookies'option.cut dirs=nIgnorenremotedirectorycomponents.Equivalentto`--cut-dirs=n'.debug=on/oDebugmode,sameas`-d'.default page=stringDefaultpagename|thesameas`--default-page=string'.delete after=on/oDeleteafterdownload|thesameas`--delete-after'.dir prex=stringTopofdirectorytree|thesameas`-Pstring'.dirstruct=on/oTurningdirstructonoro|thesameas`-x'or`-nd',respectively.dns cache=on/oTurnDNScachingon/o.SinceDNScachingisonbydefault,thisoptionisnor-mallyusedtoturnitoandisequivalentto`--no-dns-cache'.dns timeout=nSettheDNStimeout|thesameas`--dns-timeout'.domains=stringSameas`-D'(see Section4.1[SpanningHosts],page34 ).dot bytes=nSpecifythenumberofbytes\contained"inadot,asseenthroughouttheretrieval(1024bydefault).Youcanpostxthevaluewith`k'or`m',representingkilobytesandmegabytes,respectively.Withdotsettingsyoucantailorthedotretrievaltosuityourneeds,oryoucanusethepredenedstyles(see Section2.5[DownloadOptions],page6 ).dot spacing=nSpecifythenumberofdotsinasinglecluster(10bydefault).dots in line=nSpecifythenumberofdotsthatwillbeprintedineachlinethroughouttheretrieval(50bydefault).egd le=leUsestringastheEGDsocketlename.Thesameas`--egd-file=file'.exclude directories=stringSpecifyacomma-separatedlistofdirectoriesyouwishtoexcludefromdownload|thesameas`-Xstring'(see Section4.3[Directory-BasedLimits],page36 ).exclude domains=stringSameas`--exclude-domains=string'(see Section4.1[SpanningHosts],page34 ). Chapter6:StartupFile43 follow ftp=on/oFollowftplinksfromhtmldocuments|thesameas`--follow-ftp'.follow tags=stringOnlyfollowcertainhtmltagswhendoingarecursiveretrieval,justlike`--follow-tags=string'.force html=on/oIfsettoon,forcetheinputlenametoberegardedasanhtmldocument|thesameas`-F'.ftp password=stringSetyourftppasswordtostring.Withoutthissetting,thepassworddefaultsto`-wget@',whichisausefuldefaultforanonymousftpaccess.ThiscommandusedtobenamedpasswdpriortoWget1.10.ftp proxy=stringUsestringasftpproxy,insteadoftheonespeciedinenvironment.ftp user=stringSetftpusertostring.ThiscommandusedtobenamedloginpriortoWget1.10.glob=on/oTurnglobbingon/o|thesameas`--glob'and`--no-glob'.header=stringDeneaheaderforHTTPdownloads,likeusing`--header=string'.compression=stringChoosethecompressiontypetobeused.Legalvaluesare`auto'(thedefault),`gzip',and`none'.Thesameas`--compression=string'.adjust extension=on/oAdda`.html'extensionto`text/html'or`application/xhtml+xml'lesthatlackone,a`.css'extensionto`text/css'lesthatlackone,anda`.br',`.Z',`.zlib'or`.gz'tocompressedleslike`-E'.Previouslynamed`html_extension'(stillacceptable,butdeprecated).http keep alive=on/oTurnthekeep-alivefeatureonoro(defaultstoon).Turningitoisequivalentto`--no-http-keep-alive'.http password=stringSethttppassword,equivalentto`--http-password=string'.http proxy=stringUsestringashttpproxy,insteadoftheonespeciedinenvironment.http user=stringSethttpusertostring,equivalentto`--http-user=string'.https only=on/oWheninrecursivemode,onlyHTTPSlinksarefollowed(defaultstoo).https proxy=stringUsestringashttpsproxy,insteadoftheonespeciedinenvironment.ignore case=on/oWhensettoon,matchlesanddirectoriescaseinsensitively;thesameas`--ignore-case'. Chapter6:StartupFile44 ignore length=on/oWhensettoon,ignoreContent-Lengthheader;thesameas`--ignore-length'.ignore tags=stringIgnorecertainhtmltagswhendoingarecursiveretrieval,like`--ignore-tags=string'.include directories=stringSpecifyacomma-separatedlistofdirectoriesyouwishtofollowwhendownloading|thesameas`-Istring'.iri=on/oWhensettoon,enableinternationalizedURI(IRI)support;thesameas`--iri'.inet4 only=on/oForceconnectingtoIPv4addresses,obydefault.YoucanputthisintheglobalinitletodisableWget'sattemptstoresolveandconnecttoIPv6hosts.AvailableonlyifWgetwascompiledwithIPv6support.Thesameas`--inet4-only'or`-4'.inet6 only=on/oForceconnectingtoIPv6addresses,obydefault.AvailableonlyifWgetwascompiledwithIPv6support.Thesameas`--inet6-only'or`-6'.input=leReadtheurlsfromstring,like`-ifile'.keep session cookies=on/oWhenspecied,causes`save_cookies=on'toalsosavesessioncookies.See`--keep-session-cookies'.limit rate=rateLimitthedownloadspeedtonomorethanratebytespersecond.Thesameas`--limit-rate=rate'.load cookies=leLoadcookiesfromle.See`--load-cookiesfile'.local encoding=encodingForceWgettouseencodingasthedefaultsystemencoding.See`--local-encoding'.logle=leSetlogletole,thesameas`-ofile'.max redirect=numberSpeciesthemaximumnumberofredirectionstofollowforaresource.See`--max-redirect=number'.mirror=on/oTurnmirroringon/o.Thesameas`-m'.netrc=on/oTurnreadingnetrconoro.no clobber=on/oSameas`-nc'.no parent=on/oDisallowretrievingoutsidethedirectoryhierarchy,like`--no-parent'(see Section4.3[Directory-BasedLimits],page36 ). Chapter6:StartupFile45 no proxy=stringUsestringasthecomma-separatedlistofdomainstoavoidinproxyloading,insteadoftheonespeciedinenvironment.output document=leSettheoutputlename|thesameas`-Ofile'.page requisites=on/oDownloadallancillarydocumentsnecessaryforasinglehtmlpagetodisplayproperly|thesameas`-p'.passive ftp=on/oChangesettingofpassiveftp,equivalenttothe`--passive-ftp'option.password=stringSpecifypasswordstringforbothftpandhttpleretrieval.Thiscommandcanbeoverriddenusingthe`ftp_password'and`http_password'commandforftpandhttprespectively.post data=stringUsePOSTasthemethodforallHTTPrequestsandsendstringintherequestbody.Thesameas`--post-data=string'.post le=leUsePOSTasthemethodforallHTTPrequestsandsendthecontentsofleintherequestbody.Thesameas`--post-file=file'.prefer family=none/IPv4/IPv6Whengivenachoiceofseveraladdresses,connecttotheaddresseswithspeciedaddressfamilyrst.TheaddressorderreturnedbyDNSisusedwithoutchangebydefault.Thesameas`--prefer-family',whichseeforadetaileddiscussionofwhythisisuseful.private key=leSettheprivatekeyletole.Thesameas`--private-key=file'.private key type=stringSpecifythetypeoftheprivatekey,legalvaluesbeing`PEM'(thedefault)and`DER'(akaASN1).Thesameas`--private-type=string'.progress=stringSetthetypeoftheprogressindicator.Legaltypesare`dot'and`bar'.Equivalentto`--progress=string'.protocol directories=on/oWhenset,usetheprotocolnameasadirectorycomponentoflocallenames.Thesameas`--protocol-directories'.proxy password=stringSetproxyauthenticationpasswordtostring,like`--proxy-password=string'.proxy user=stringSetproxyauthenticationusernametostring,like`--proxy-user=string'.quiet=on/oQuietmode|thesameas`-q'.quota=quotaSpecifythedownloadquota,whichisusefultoputintheglobalwgetrc.Whendownloadquotaisspecied,Wgetwillstopretrievingafterthedownloadsumhas Chapter6:StartupFile46 becomegreaterthanquota.Thequotacanbespeciedinbytes(default),kbytes`k'appended)ormbytes(`m'appended).Thus`quota=5m'willsetthequotato5megabytes.Notethattheuser'sstartupleoverridessystemsettings.random le=leUseleasasourceofrandomnessonsystemslacking/dev/random.random wait=on/oTurnrandombetween-requestwaittimesonoro.Thesameas`--random-wait'.read timeout=nSettheread(andwrite)timeout|thesameas`--read-timeout=n'.reclevel=nRecursionlevel(depth)|thesameas`-ln'.recursive=on/oRecursiveon/o|thesameas`-r'.referer=stringSetHTTP`Referer:'headerjustlike`--referer=string'.(Notethatitwasthefolkswhowrotethehttpspecwhogotthespellingof\referrer"wrong.)relative only=on/oFollowonlyrelativelinks|thesameas`-L'(see Section4.4[RelativeLinks],page37 ).remote encoding=encodingForceWgettouseencodingasthedefaultremoteserverencoding.See`--remote-encoding'.remove listing=on/oIfsettoon,removeftplistingsdownloadedbyWget.Settingittooisthesameas`--no-remove-listing'.restrict le names=unix/windowsRestrictthelenamesgeneratedbyWgetfromURLs.See`--restrict-file-names'foramoredetaileddescription.retr symlinks=on/oWhensettoon,retrievesymboliclinksasiftheywereplainles;thesameas`--retr-symlinks'.retry connrefused=on/oWhensettoon,consider\connectionrefused"atransienterror|thesameas`--retry-connrefused'.robots=on/oSpecifywhetherthenorobotsconventionisrespectedbyWget,\on"bydefault.Thisswitchcontrolsboththe/robots.txtandthe`nofollow'aspectofthespec.See Section9.1[RobotExclusion],page58 ,formoredetailsaboutthis.Besureyouknowwhatyouaredoingbeforeturningthiso.save cookies=leSavecookiestole.Thesameas`--save-cookiesfile'.save headers=on/oSameas`--save-headers'.secure protocol=stringChoosethesecureprotocoltobeused.Legalvaluesare`auto'(thedefault),`SSLv2',`SSLv3',and`TLSv1'.Thesameas`--secure-protocol=string'. Chapter6:StartupFile47 server response=on/oChoosewhetherornottoprintthehttpandftpserverresponses|thesameas`-S'.show all dns entries=on/oWhenaDNSnameisresolved,showalltheIPaddresses,notjusttherstthree.span hosts=on/oSameas`-H'.spider=on/oSameas`--spider'.strict comments=on/oSameas`--strict-comments'.timeout=nSetallapplicabletimeoutvalueston,thesameas`-Tn'.timestamping=on/oTurntimestampingon/o.Thesameas`-N'(see Chapter5[Time-Stamping],page38 ).use server timestamps=on/oIfsetto`off',Wgetwon'tsetthelocalle'stimestampbytheoneontheserver(sameas`--no-use-server-timestamps').tries=nSetnumberofretriesperurl|thesameas`-tn'.use proxy=on/oWhensettoo,don'tuseproxyevenwhenproxy-relatedenvironmentvariablesareset.Inthatcaseitisthesameasusing`--no-proxy'.user=stringSpecifyusernamestringforbothftpandhttpleretrieval.Thiscommandcanbeoverriddenusingthe`ftp_user'and`http_user'commandforftpandhttprespectively.user agent=stringUseragentidenticationsenttotheHTTPServer|thesameas`--user-agent=string'.verbose=on/oTurnverboseon/o|thesameas`-v'/`-nv'.wait=nWaitnsecondsbetweenretrievals|thesameas`-wn'.wait retry=nWaituptonsecondsbetweenretriesoffailedretrievalsonly|thesameas`--waitretry=n'.Notethatthisisturnedonbydefaultintheglobalwgetrc.6.4SampleWgetrcThisisthesampleinitializationle,asgiveninthedistribution.Itisdividedintwosection|oneforglobalusage(suitableforglobalstartuple),andoneforlocalusage(suitablefor$HOME/.wgetrc).Becarefulaboutthethingsyouchange.Notethatalmostallthelinesarecommentedout.Foracommandtohaveanyeect,youmustremovethe`#'characteratthebeginningofitsline.######SampleWgetinitializationfile.wgetrc Chapter6:StartupFile48 #####Youcanusethisfiletochangethedefaultbehaviourofwgetorto##avoidhavingtotypemanymanycommand-lineoptions.Thisfiledoes##notcontainacomprehensivelistofcommands--lookatthemanual##tofindoutwhatyoucanputintothisfile.Youcanfindthishere:##$infowget.info'StartupFile'##Oronlinehere:##https://www.gnu.org/software/wget/manual/wget.html#Startup-File####Wgetinitializationfilecanresidein/usr/local/etc/wgetrc##(global,forallusers)or$HOME/.wgetrc(forasingleuser).####Tousethesettingsinthisfile,youwillhavetouncommentthem,##aswellaschangethem,inmostcases,asthevaluesonthe##commented-outlinesarethedefaultvalues(e.g."off").####Commandarecase-,underscore-andminus-insensitive.##Forexampleftp_proxy,ftp-proxyandftpproxyarethesame.####Globalsettings(usefulforsettingupin/usr/local/etc/wgetrc).##Thinkwellbeforeyouchangethem,sincetheymayreducewget's##functionality,andmakeitbehavecontrarytothedocumentation:###Youcansetretrievequotaforbeginnersbyspecifyingavalue#optionallyfollowedby'K'(kilobytes)or'M'(megabytes).The#defaultquotaisunlimited.#quota=inf#Youcanlower(orraise)thedefaultnumberofretrieswhen#downloadingafile(defaultis20).#tries=20#Loweringthemaximumdepthoftherecursiveretrievalishandyto#preventnewbiesfromgoingtoo"deep"whentheyunwittinglystart#therecursiveretrieval.Thedefaultis5.#reclevel=5#BydefaultWgetuses"passiveFTP"transferwheretheclient#initiatesthedataconnectiontotheserverratherthantheother#wayaround.ThatisrequiredonsystemsbehindNATwheretheclient#computercannotbeeasilyreachedfromtheInternet.However,some#firewallssoftwareexplicitlysupportsactiveFTPandinfacthas#problemssupportingpassivetransfer.Ifyouareinsuch#environment,use"passive_ftp=off"toreverttoactiveFTP.#passive_ftp=off#The"wait"commandbelowmakesWgetwaitbetweeneveryconnection.#If,instead,youwantWgettowaitonlybetweenretriesoffailed Chapter6:StartupFile49 #downloads,setwaitretrytomaximumnumberofsecondstowait(Wget#willuse"linearbackoff",waiting1secondafterthefirstfailure#onafile,2secondsafterthesecondfailure,etc.uptothismax).#waitretry=10####Localsettings(forausertosetinhis$HOME/.wgetrc).Itis##*highly*undesirabletoputthesesettingsintheglobalfile,since##theyarepotentiallydangerousto"normal"users.####Evenwhensettingupyourown~/.wgetrc,youshouldknowwhatyou##aredoingbeforedoingso.###Setthistoontousetimestampingbydefault:#timestamping=off#ItisagoodideatomakeWgetsendyouremailaddressina`From:'#headerwithyourrequest(sothatserveradministratorscancontact#youincaseoferrors).Wgetdoes*not*send`From:'bydefault.#header=From:YourNameuser;name;@sit;.do;main;#Youcansetupotherheaders,likeAccept-Language.Accept-Language#is*not*sentbydefault.#header=Accept-Language:en#YoucansetthedefaultproxiesforWgettouseforhttp,https,andftp.#Theywilloverridethevalueintheenvironment.#https_proxy=http://proxy.yoyodyne.com:18023/#http_proxy=http://proxy.yoyodyne.com:18023/#ftp_proxy=http://proxy.yoyodyne.com:18023/#Ifyoudonotwanttouseproxyatall,setthistooff.#use_proxy=on#Youcancustomizetheretrievaloutlook.Validoptionsaredefault,#binary,megaandmicro.#dot_style=default#SettingthistooffmakesWgetnotdownload/robots.txt.Besureto#know*exactly*what/robots.txtisandhowitisusedbeforechanging#thedefault!#robots=on#ItcanbeusefultomakeWgetwaitbetweenconnections.Setthisto#thenumberofsecondsyouwantWgettowait.#wait=0#Youcanforcecreatingdirectorystructure,evenifasingleisbeing#retrieved,bysettingthistoon.#dirstruct=off 50 #Youcanturnonrecursiveretrievingbydefault(don'tdothisif#youarenotsureyouknowwhatitmeans)bysettingthistoon.#recursive=off#ToalwaysbackupfileXasX.origbeforeconvertingitslinks(due#to-k/--convert-links/convert_links=onhavingbeenspecified),#setthisvariabletoon:#backup_converted=off#TohaveWgetfollowFTPlinksfromHTMLfilesbydefault,setthis#toon:#follow_ftp=off#Totryipv6addressesfirst:#prefer-family=IPv6#SetdefaultIRIsupportstate#iri=off#Forcethedefaultsystemencoding#localencoding=UTF-8#Forcethedefaultremoteserverencoding#remoteencoding=UTF-8#Turnontopreventfollowingnon-HTTPSlinkswheninrecursivemode#httpsonly=off#TuneHTTPSsecurity(auto,SSLv2,SSLv3,TLSv1,PFS)#secureprotocol=auto 51 7ExamplesTheexamplesaredividedintothreesectionslooselybasedontheircomplexity.7.1SimpleUsageSayyouwanttodownloadaurl.Justtype:wgethttp://fly.srk.fer.hr/Butwhatwillhappeniftheconnectionisslow,andtheleislengthy?Theconnectionwillprobablyfailbeforethewholeleisretrieved,morethanonce.Inthiscase,Wgetwilltrygettingtheleuntiliteithergetsthewholeofit,orexceedsthedefaultnumberofretries(thisbeing20).Itiseasytochangethenumberoftriesto45,toinsurethatthewholelewillarrivesafely:wget--tries=45http://fly.srk.fer.hr/jpg/flyweb.jpgNowlet'sleaveWgettoworkinthebackground,andwriteitsprogresstologlelog.Itistiringtotype`--tries',soweshalluse`-t'.wget-t45-ologhttp://fly.srk.fer.hr/jpg/flyweb.jpg&TheampersandattheendofthelinemakessurethatWgetworksinthebackground.Tounlimitthenumberofretries,use`-tinf'.Theusageofftpisassimple.Wgetwilltakecareofloginandpassword.wgetftp://gnjilux.srk.fer.hr/welcome.msgIfyouspecifyadirectory,Wgetwillretrievethedirectorylisting,parseitandconvertittohtml.Try:wgetftp://ftp.gnu.org/pub/gnu/linksindex.html7.2AdvancedUsageYouhavealethatcontainstheURLsyouwanttodownload?Usethe`-i'switch:wget-ifileIfyouspecify`-'aslename,theurlswillbereadfromstandardinput.CreateavelevelsdeepmirrorimageoftheGNUwebsite,withthesamedirectorystructuretheoriginalhas,withonlyonetryperdocument,savingthelogoftheactivitiestognulog:wget-rhttps://www.gnu.org/-ognulogThesameastheabove,butconvertthelinksinthedownloadedlestopointtolocalles,soyoucanviewthedocumentso-line:wget--convert-links-rhttps://www.gnu.org/-ognulogRetrieveonlyonehtmlpage,butmakesurethatalltheelementsneededforthepagetobedisplayed,suchasinlineimagesandexternalstylesheets,arealsodownloaded.Alsomakesurethedownloadedpagereferencesthedownloadedlinks.wget-p--convert-linkshttp://www.example.com/dir/page.htmlThehtmlpagewillbesavedtowww.example.com/dir/page.html,andtheimages,stylesheets,etc.,somewhereunderwww.example.com/,dependingonwheretheywereontheremoteserver.Thesameastheabove,butwithoutthewww.example.com/directory.Infact,Idon'twanttohaveallthoserandomserverdirectoriesanyway|justsaveallthoselesunderadownload/subdirectoryofthecurrentdirectory.wget-p--convert-links-nH-nd-Pdownload\http://www.example.com/dir/page.html Chapter7:Examples52 Retrievetheindex.htmlof`www.lycos.com',showingtheoriginalserverheaders:wget-Shttp://www.lycos.com/Savetheserverheaderswiththele,perhapsforpost-processing.wget--save-headershttp://www.lycos.com/moreindex.htmlRetrievethersttwolevelsof`wuarchive.wustl.edu',savingthemto/tmp.wget-r-l2-P/tmpftp://wuarchive.wustl.edu/Youwanttodownloadallthegifsfromadirectoryonanhttpserver.Youtried`wgethttp://www.example.com/dir/*.gif',butthatdidn'tworkbecausehttpretrievaldoesnotsupportglobbing.Inthatcase,use:wget-r-l1--no-parent-A.gifhttp://www.example.com/dir/Moreverbose,buttheeectisthesame.`-r-l1'meanstoretrieverecursively(see Chapter3[RecursiveDownload],page33 ),withmaximumdepthof1.`--no-parent'meansthatreferencestotheparentdirectoryareignored(see Section4.3[Directory-BasedLimits],page36 ),and`-A.gif'meanstodownloadonlythegifles.`-A"*.gif"'wouldhaveworkedtoo.Supposeyouwereinthemiddleofdownloading,whenWgetwasinterrupted.Nowyoudonotwanttoclobberthelesalreadypresent.Itwouldbe:wget-nc-rhttps://www.gnu.org/Ifyouwanttoencodeyourownusernameandpasswordtohttporftp,usetheappropriateurlsyntax(see Section2.1[URLFormat],page2 ).wgetftp://hniksic:mypassword@unix.example.com/.emacsNote,however,thatthisusageisnotadvisableonmulti-usersystemsbecauseitrevealsyourpasswordtoanyonewholooksattheoutputofps.Youwouldliketheoutputdocumentstogotostandardoutputinsteadoftoles?wget-O-http://jagor.srce.hr/http://www.srce.hr/Youcanalsocombinethetwooptionsandmakepipelinestoretrievethedocumentsfromremotehotlists:wget-O-http://cool.list.com/|wget--force-html-i-7.3VeryAdvancedUsageIfyouwishWgettokeepamirrorofapage(orftpsubdirectories),use`--mirror'(`-m'),whichistheshorthandfor`-r-linf-N'.YoucanputWgetinthecrontableaskingittorecheckasiteeachSunday:crontab00**0wget--mirrorhttps://www.gnu.org/-o/home/me/weeklogInadditiontotheabove,youwantthelinkstobeconvertedforlocalviewing.But,afterhavingreadthismanual,youknowthatlinkconversiondoesn'tplaywellwithtimestamping,soyoualsowantWgettobackuptheoriginalhtmllesbeforetheconversion.Wgetinvocationwouldlooklikethis:wget--mirror--convert-links--backup-converted\https://www.gnu.org/-o/home/me/weeklogButyou'vealsonoticedthatlocalviewingdoesn'tworkallthatwellwhenhtmllesaresavedunderextensionsotherthan`.html',perhapsbecausetheywereservedasindex.cgi.Soyou'dlikeWgettorenameallthelesservedwithcontent-type`text/html'or`application/xhtml+xml'toname.html.wget--mirror--convert-links--backup-converted\ 53 --html-extension-o/home/me/weeklog\https://www.gnu.org/Or,withlesstyping:wget-m-k-K-Ehttps://www.gnu.org/-o/home/me/weeklog 54 8VariousThischaptercontainsallthestuthatcouldnottanywhereelse.8.1ProxiesProxiesarespecial-purposehttpserversdesignedtotransferdatafromremoteserverstolocalclients.Onetypicaluseofproxiesislighteningnetworkloadforusersbehindaslowconnection.Thisisachievedbychannelingallhttpandftprequeststhroughtheproxywhichcachesthetransferreddata.Whenacachedresourceisrequestedagain,proxywillreturnthedatafromcache.Anotheruseforproxiesisforcompaniesthatseparate(forsecurityreasons)theirinternalnetworksfromtherestofInternet.InordertoobtaininformationfromtheWeb,theirusersconnectandretrieveremotedatausinganauthorizedproxy.Wgetsupportsproxiesforbothhttpandftpretrievals.Thestandardwaytospecifyproxylocation,whichWgetrecognizes,isusingthefollowingenvironmentvariables:http_proxyhttps_proxyIfset,thehttp_proxyandhttps_proxyvariablesshouldcontaintheurlsoftheproxiesforhttpandhttpsconnectionsrespectively.ftp_proxyThisvariableshouldcontaintheurloftheproxyforftpconnections.Itisquitecommonthathttp_proxyandftp_proxyaresettothesameurl.no_proxyThisvariableshouldcontainacomma-separatedlistofdomainextensionsproxyshouldnotbeusedfor.Forinstance,ifthevalueofno_proxyis`.mit.edu',proxywillnotbeusedtoretrievedocumentsfromMIT.Inadditiontotheenvironmentvariables,proxylocationandsettingsmaybespeciedfromwithinWgetitself.`--no-proxy'`proxy=on/off'Thisoptionandthecorrespondingcommandmaybeusedtosuppresstheuseofproxy,eveniftheappropriateenvironmentvariablesareset.`http_proxy=URL'`https_proxy=URL'`ftp_proxy=URL'`no_proxy=string'Thesestartuplevariablesallowyoutooverridetheproxysettingsspeciedbytheenvironment.Someproxyserversrequireauthorizationtoenableyoutousethem.Theauthorizationconsistsofusernameandpassword,whichmustbesentbyWget.Aswithhttpauthorization,severalauthenticationschemesexist.ForproxyauthorizationonlytheBasicauthenticationschemeiscurrentlyimplemented.Youmayspecifyyourusernameandpasswordeitherthroughtheproxyurlorthroughthecommand-lineoptions.Assumingthatthecompany'sproxyislocatedat`proxy.company.com'atport8001,aproxyurllocationcontainingauthorizationdatamightlooklikethis:http://hniksic:mypassword@proxy.company.com:8001/Alternatively,youmayusethe`proxy-user'and`proxy-password'options,andtheequiva-lent.wgetrcsettingsproxy_userandproxy_passwordtosettheproxyusernameandpassword. Chapter8:Various55 8.2DistributionLikeallGNUutilities,thelatestversionofWgetcanbefoundatthemasterGNUarchivesiteftp.gnu.org,anditsmirrors.Forexample,Wget1.20canbefoundat https://ftp.gnu.org/pub/gnu/wget/wget-1.20.tar.gz 8.3WebSiteTheocialwebsiteforGNUWgetisat https//www.gnu.org/software/wget/ .However,mostusefulinformationresidesat\TheWgetWgiki", http://wget.addictivecode.org/ .8.4MailingListsPrimaryListTheprimarymailinglistfordiscussion,bug-reports,orquestionsaboutGNUWgetisat bug-wget@gnu.org .Tosubscribe,sendanemailto bug-wget-join@gnu.org ,orvisit https://lists.gnu.org/mailman/listinfo/bug-wget .Youdonotneedtosubscribetosendamessagetothelist;however,pleasenotethatunsub-scribedmessagesaremoderated,andmaytakeawhilebeforetheyhitthelist|usuallyaroundaday.Ifyouwantyourmessagetoshowupimmediately,pleasesubscribetothelistbeforepost-ing.Archivesforthelistmaybefoundat https://lists.gnu.org/archive/html/bug-wget/ .AnNNTP/Usenettishgatewayisalsoavailablevia Gmane(http://gmane.org/about.php) .YoucanseetheGmanearchivesat http://news.gmane.org/gmane.comp.web.wget.general .NotethattheGmanearchivesconvenientlyincludemessagesfromboththecurrentlist,andthepreviousone.MessagesalsoshowupintheGmanearchivessoonerthantheydoat https://lists.gnu.org .ObsoleteListsPreviously,themailinglist wget@sunsite.dk wasusedasthemaindiscussionlist,andanotherlist, wget-patches@sunsite.dk wasusedforsubmittinganddiscussingpatchestoGNUWget.Messagesfrom wget@sunsite.dk arearchivedat https://www.mail-archive.com/wget%40sunsite.dk/ andat http://news.gmane.org/gmane.comp.web.wget.general (whichalsocontinuestoarchivethecurrentlist, bug-wget@gnu.org ).Messagesfrom wget-patches@sunsite.dk arearchivedat http://news.gmane.org/gmane.comp.web.wget.patches .8.5InternetRelayChatInadditiontothemailinglists,wealsohaveasupportchannelsetupviaIRCatirc.freenode.org,#wget.Comecheckitout!8.6ReportingBugsYouarewelcometosubmitbugreportsviatheGNUWgetbugtracker(see https://savannah.gnu.org/bugs/?func=additem&group=wget )ortoourmailinglist bug-wget@gnu.org .Visit https://lists.gnu.org/mailman/listinfo/bug-wget togetmoreinfo(howtosubscribe,listarchives,...). Chapter8:Various56 Beforeactuallysubmittingabugreport,pleasetrytofollowafewsimpleguidelines.1.Pleasetrytoascertainthatthebehavioryouseereallyisabug.IfWgetcrashes,it'sabug.IfWgetdoesnotbehaveasdocumented,it'sabug.Ifthingsworkstrange,butyouarenotsureaboutthewaytheyaresupposedtowork,itmightwellbeabug,butyoumightwanttodouble-checkthedocumentationandthemailinglists(see Section8.4[MailingLists],page55 ).2.Trytorepeatthebuginassimplecircumstancesaspossible.E.g.ifWgetcrasheswhiledownloading`wget-rl0-kKE-t5--no-proxyhttp://example.com-o/tmp/log',youshouldtrytoseeifthecrashisrepeatable,andifwilloccurwithasimplersetofoptions.Youmighteventrytostartthedownloadatthepagewherethecrashoccurredtoseeifthatpagesomehowtriggeredthecrash.Also,whileIwillprobablybeinterestedtoknowthecontentsofyour.wgetrcle,justdumpingitintothedebugmessageisprobablyabadidea.Instead,youshouldrsttrytoseeifthebugrepeatswith.wgetrcmovedoutoftheway.Onlyifitturnsoutthat.wgetrcsettingsaectthebug,mailmetherelevantpartsofthele.3.PleasestartWgetwith`-d'optionandsendustheresultingoutput(orrelevantpartsthereof).IfWgetwascompiledwithoutdebugsupport,recompileit|itismucheasiertotracebugswithdebugsupporton.Note:pleasemakesuretoremoveanypotentiallysensitiveinformationfromthedebuglogbeforesendingittothebugaddress.The-dwon'tgooutofitswaytocollectsensitiveinformation,butthelogwillcontainafairlycompletetranscriptofWget'scommunicationwiththeserver,whichmayincludepasswordsandpiecesofdownloadeddata.Sincethebugaddressispublicallyarchived,youmayassumethatallbugreportsarevisibletothepublic.4.IfWgethascrashed,trytorunitinadebugger,e.g.gdb`whichwget`coreandtypewheretogetthebacktrace.Thismaynotworkifthesystemadministratorhasdisabledcoreles,butitissafetotry.8.7PortabilityLikeallGNUsoftware,WgetworksontheGNUsystem.However,sinceitusesGNUAutoconfforbuildingandconguring,andmostlyavoidsusing\special"featuresofanyparticularUnix,itshouldcompile(andwork)onallcommonUnix avors.VariousWgetversionshavebeencompiledandtestedundermanykindsofUnixsystems,includingGNU/Linux,Solaris,SunOS4.x,MacOSX,OSF(akaDigitalUnixorTru64),Ultrix,*BSD,IRIX,AIX,andothers.SomeofthosesystemsarenolongerinwidespreaduseandmaynotbeabletosupportrecentversionsofWget.IfWgetfailstocompileonyoursystem,wewouldliketoknowaboutit.Thankstokindcontributors,thisversionofWgetcompilesandworkson32-bitMicrosoftWindowsplatforms.IthasbeencompiledsuccessfullyusingMSVisualC++6.0,Watcom,BorlandC,andGCCcompilers.Naturally,itiscrippledofsomefeaturesavailableonUnix,butitshouldworkasasubstituteforpeoplestuckwithWindows.NotethatWindows-specicportionsofWgetarenotguaranteedtobesupportedinthefuture,althoughthishasbeenthecaseinpracticeformanyyearsnow.AllquestionsandproblemsinWindowsusageshouldbereportedtoWgetmailinglistat wget@sunsite.dk wherethevolunteerswhomaintaintheWindows-relatedfeaturesmightlookatthem.SupportforbuildingonMS-DOSviaDJGPPhasbeencontributedbyGisleVanem;aporttoVMSismaintainedbyStevenSchweda,andisavailableat https://antinode.info/dec/sw/wget.html . Chapter8:Various57 8.8SignalsSincethepurposeofWgetisbackgroundwork,itcatchesthehangupsignal(SIGHUP)andignoresit.Iftheoutputwasonstandardoutput,itwillberedirectedtoalenamedwget-log.Otherwise,SIGHUPisignored.ThisisconvenientwhenyouwishtoredirecttheoutputofWgetafterhavingstartedit.$wgethttp://www.gnus.org/dist/gnus.tar.gz&...$kill-HUP%%SIGHUPreceived,redirectingoutputto`wget-log'.Otherthanthat,Wgetwillnottrytointerferewithsignalsinanyway.C-c,kill-TERMandkill-KILLshouldkillitalike. 58 9AppendicesThischaptercontainssomereferencesIconsideruseful.9.1RobotExclusionItisextremelyeasytomakeWgetwanderaimlesslyaroundawebsite,suckingalltheavailabledatainprogress.`wget-rsite',andyou'reset.Great?Notfortheserveradmin.AslongasWgetisonlyretrievingstaticpages,anddoingitatareasonablerate(seethe`--wait'option),there'snotmuchofaproblem.ThetroubleisthatWgetcan'ttellthedierencebetweenthesmalleststaticpageandthemostdemandingCGI.AsiteIknowhasasectionhandledbyaCGIPerlscriptthatconvertsInfolestohtmlonthe y.Thescriptisslow,butworkswellenoughforhumanusersviewinganoccasionalInfole.However,whensomeone'srecursiveWgetdownloadstumblesupontheindexpagethatlinkstoalltheInfolesthroughthescript,thesystemisbroughttoitskneeswithoutprovidinganythingusefultotheuser(ThistaskofconvertingInfolescouldbedonelocallyandaccesstoInfodocumentationforallinstalledGNUsoftwareonasystemisavailablefromtheinfocommand).Toavoidthiskindofaccident,aswellastopreserveprivacyfordocumentsthatneedtobeprotectedfromwell-behavedrobots,theconceptofrobotexclusionwasinvented.Theideaisthattheserveradministratorsanddocumentauthorscanspecifywhichportionsofthesitetheywishtoprotectfromrobotsandthosetheywillpermitaccess.Themostpopularmechanism,andthedefactostandardsupportedbyallthemajorrobots,isthe\RobotsExclusionStandard"(RES)writtenbyMartijnKosteretal.in1994.ItspeciestheformatofatextlecontainingdirectivesthatinstructtherobotswhichURLpathstoavoid.Tobefoundbytherobots,thespecicationsmustbeplacedin/robots.txtintheserverroot,whichtherobotsareexpectedtodownloadandparse.AlthoughWgetisnotawebrobotinthestrictestsenseoftheword,itcandownloadlargepartsofthesitewithouttheuser'sinterventiontodownloadanindividualpage.Becauseofthat,WgethonorsRESwhendownloadingrecursively.Forinstance,whenyouissue:wget-rhttp://www.example.com/Firsttheindexof`www.example.com'willbedownloaded.IfWgetndsthatitwantstodownloadmoredocumentsfromthatserver,itwillrequest`http://www.example.com/robots.txt'and,iffound,useitforfurtherdownloads.robots.txtisloadedonlyoncepereachserver.Untilversion1.8,Wgetsupportedtherstversionofthestandard,writtenbyMar-tijnKosterin1994andavailableat http://www.robotstxt.org/orig.html .Asofversion1.8,Wgethassupportedtheadditionaldirectivesspeciedintheinternetdraft` raf;t-ko;ster;-rob;ots-;.t;xt00;'titled\AMethodforWebRobotsControl".Thedraft,whichhasasfarasIknownevermadetoanrfc,isavailableat http://www.robotstxt.org/norobots-rfc.txt .ThismanualnolongerincludesthetextoftheRobotExclusionStandard.Thesecond,lessknownmechanism,enablestheauthorofanindividualdocumenttospecifywhethertheywantthelinksfromtheletobefollowedbyarobot.ThisisachievedusingtheMETAtag,likethis:name="robots"meta;-525;content="nofollow"Thisisexplainedinsomedetailat http://www.robotstxt.org/meta.html .Wgetsupportsthismethodofrobotexclusioninadditiontotheusual/robots.txtexclusion.Ifyouknowwhatyouaredoingandreallyreallywishtoturnotherobotexclusion,settherobotsvariableto`off'inyour.wgetrc.Youcanachievethesameeectfromthecommandlineusingthe-eswitch,e.g.`wget-erobots=offurl...'. Chapter9:Appendices59 9.2SecurityConsiderationsWhenusingWget,youmustbeawarethatitsendsunencryptedpasswordsthroughthenetwork,whichmaypresentasecurityproblem.Herearethemainissues,andsomesolutions.1.Thepasswordsonthecommandlinearevisibleusingps.Thebestwayarounditistousewget-i-andfeedtheurlstoWget'sstandardinput,eachonaseparateline,terminatedbyC-d.Anotherworkaroundistouse.netrctostorepasswords;however,storingunencryptedpasswordsisalsoconsideredasecurityrisk.2.Usingtheinsecurebasicauthenticationscheme,unencryptedpasswordsaretransmittedthroughthenetworkroutersandgateways.3.Theftppasswordsarealsoinnowayencrypted.Thereisnogoodsolutionforthisatthemoment.4.Althoughthe\normal"outputofWgettriestohidethepasswords,debugginglogsshowthem,inallforms.Thisproblemisavoidedbybeingcarefulwhenyousenddebuglogs(yes,evenwhenyousendthemtome).9.3ContributorsGNUWgetwaswrittenbyHrvojeNiksic hniksic@xemacs.org ,However,thedevelopmentofWgetcouldneverhavegoneasfarasithas,wereitnotforthehelpofmanypeople,eitherwithbugreports,featureproposals,patches,orletterssaying\Thanks!".Specialthanksgoestothefollowingpeople(noparticularorder):DanHarkless|contributedalotofcodeanddocumentationofextremelyhighquality,aswellasthe--page-requisitesandrelatedoptions.HewastheprincipalmaintainerforsometimeandreleasedWget1.6.IanAbbott|contributedbugxes,Windows-relatedxes,andprovidedaprototypeim-plementationofthebreadth-rstrecursivedownload.Co-maintainedWgetduringthe1.8releasecycle.Thedotsrc.orgcrew,inparticularKarstenThygesen|donatedsystemresourcessuchasthemailinglist,webspace,ftpspace,andversioncontrolrepositories,alongwithalotoftimetomaketheseactuallywork.ChristianReinigerwasofinvaluablehelpwithsettingupSubversion.HeikoHerold|providedhigh-qualityWindowsbuildsandcontributedbugandbuildreportsformanyyears.ShawnMcHorse|bugreportsandpatches.KavehR.Ghazi|on-the- yansi2knr-ization.Lotsofportabilityxes.GordonMatzigkeit|.netrcsupport.ZlatkoCalusic,TomislavVujecandDrazenKacar|featuresuggestionsand\philosophical"discussions.DarkoBudor|initialporttoWindows.AntonioRosella|helpandsuggestions,plustheinitialItaliantranslation.TomislavPetrovic,MarioMikocevic|manybugreportsandsuggestions.FrancoisPinard|manythoroughbugreportsanddiscussions.KarlEichwalder|lotsofhelpwithinternationalization,Makelelayoutandmanyotherthings.JunioHamano|donatedsupportforOpieandhttpDigestauthentication.MauroTortonesi|improvedIPv6support,addingsupportfordualfamilysystems.Refac-toredandenhancedFTPIPv6code.MaintainedGNUWgetfrom2004{2007. 60 ChristopherG.Lewis|maintenanceoftheWindowsversionofGNUWGet.GisleVanem|manyhelpfulpatchesandimprovements,especiallyforWindowsandMS-DOSsupport.RalfWildenhues|contributedpatchestoconvertWgettouseAutomakeaspartofitsbuildprocess,andvariousbugxes.StevenSchubiger|Manyhelpfulpatches,bugxesandimprovements.Notably,conversionofWgettousetheGnulibquotesandquoteargsmodules,andtheadditionofpasswordpromptsattheconsole,viatheGnulibgetpasswd-gnumodule.TedMielczarek|donatedsupportforCSS.SaintXavier|SupportforIRIs(RFC3987).Peoplewhoprovideddonationsfordevelopment|includingBrianGough.Thefollowingpeoplehaveprovidedpatches,bug/buildreports,usefulsuggestions,betatest-ingservices,fanmailandalltheotherthingsthatmakemaintenancesomuchfun:TimAdam,AdrianAichner,MartinBaehr,DieterBaron,RogerBeeman,DanBerger,T.Bharath,ChristianBiere,PaulBludov,DanielBodea,MarkBoyns,JohnBurden,JulienButy,WanderleiCavassin,GillesCedoc,TimCharron,NoelCragg,KristijanConkas,JohnDaily,An-dreasDamm,AhmonDancy,AndrewDavison,BertrandDemiddelaer,AlexanderDergachev,AndrewDeryabin,UlrichDrepper,MarcDuponcheel,DamirDzeko,AlanEldridge,Hans-AndreasEngel,AleksandarErkalovic,AndyEskilsson,Jo~aoFerreira,ChristianFraenkel,DavidFritz,MikeFrysinger,CharlesC.Fu,FUJISHIMASatsuki,MasashiFujita,HowardGayle,Mar-celGerrits,LembleGregory,HansGrobler,AlainGuibert,MathieuGuillaume,AaronHawley,JochenHein,KarlHeuer,MadhusudanHosaagrahara,HIROSEMasaaki,UlfHarnhammar,Gre-gorHoeit,ErikMagnusHulthen,RichardHuveneers,JonasJensen,LarryJones,SimonJosef-sson,MarioJuric,HackKampbjrn,ConstKaplinsky,GoranKezunovic,IgorKhristophorov,RobertKleine,KOJIMAHaime,FilaKolodny,AlexanderKourakos,MartinKraemer,SamiKrank,JayKrell,o&&(SimosKSenitellis),ChristianLackas,HrvojeLacko,DanielS.Lewart,NicolasLichtmeier,DaveLove,AlexanderV.Lukyanov,ThomasLunig,AndreMajorel,AurelienMarchand,MatthewJ.Mellon,JordanMendelson,TedMielczarek,RobertMillan,LinZheMin,JanMinar,TimMooney,KeithMoore,AdamD.Moss,SimonMunton,CharlieNegyesi,R.K.Owen,JimParis,KennyParnell,LeonidPetrov,SimonePi-unno,AndrewPollock,StevePothier,JanPrikryl,MarinPurgar,CsabaRaduly,KeithRefson,BillRichardson,TylerRiddle,TobiasRingstrom,JochenRoderburg,JuanJoseRodrguez,Ma-ciejW.Rozycki,EdwardJ.Sabol,HeinzSalzmann,RobertSchmidt,NicolasSchodet,BennoSchulenberg,AndreasSchwab,StevenM.Schweda,ChrisSeawood,PranabShenoy,DennisSmit,ToomasSoome,TageStabell-Kulo,PhilipStadermann,DanielStenberg,SvenSternberger,MarkusStrasser,JohnSummereld,SzakacsitsSzabolcs,MikeThomas,PhilippThomas,MauroTortonesi,DaveTurner,GisleVanem,RabinVincent,RussellVincent,ZeljkoVrba,CharlesGWaldman,DouglasE.Wegscheid,RalfWildenhues,JoshuaDavidWilliams,BenjaminWolsey,SaintXavier,YAMAZAKIMakoto,JasminZainul,BojanZdrnja,KristijanZimmer,XinZou.ApologiestoallwhoIaccidentallyleftout,andmanythankstoallthesubscribersoftheWgetmailinglist. 61 AppendixACopyingthismanualA.1GNUFreeDocumentationLicenseVersion1.3,3November2008Copyrightc 2000-2002,2007-2008,2015,2018FreeSoftwareFoundation,Inc. http://fsf.org/ Everyoneispermittedtocopyanddistributeverbatimcopiesofthislicensedocument,butchangingitisnotallowed.0.PREAMBLEThepurposeofthisLicenseistomakeamanual,textbook,orotherfunctionalandusefuldocumentfreeinthesenseoffreedom:toassureeveryonetheeectivefreedomtocopyandredistributeit,withorwithoutmodifyingit,eithercommerciallyornoncommercially.Secondarily,thisLicensepreservesfortheauthorandpublisherawaytogetcreditfortheirwork,whilenotbeingconsideredresponsibleformodicationsmadebyothers.ThisLicenseisakindof\copyleft",whichmeansthatderivativeworksofthedocumentmustthemselvesbefreeinthesamesense.ItcomplementstheGNUGeneralPublicLicense,whichisacopyleftlicensedesignedforfreesoftware.WehavedesignedthisLicenseinordertouseitformanualsforfreesoftware,becausefreesoftwareneedsfreedocumentation:afreeprogramshouldcomewithmanualsprovidingthesamefreedomsthatthesoftwaredoes.ButthisLicenseisnotlimitedtosoftwaremanuals;itcanbeusedforanytextualwork,regardlessofsubjectmatterorwhetheritispublishedasaprintedbook.WerecommendthisLicenseprincipallyforworkswhosepurposeisinstructionorreference.1.APPLICABILITYANDDEFINITIONSThisLicenseappliestoanymanualorotherwork,inanymedium,thatcontainsanoticeplacedbythecopyrightholdersayingitcanbedistributedunderthetermsofthisLicense.Suchanoticegrantsaworld-wide,royalty-freelicense,unlimitedinduration,tousethatworkundertheconditionsstatedherein.The\Document",below,referstoanysuchmanualorwork.Anymemberofthepublicisalicensee,andisaddressedas\you".Youacceptthelicenseifyoucopy,modifyordistributetheworkinawayrequiringpermissionundercopyrightlaw.A\ModiedVersion"oftheDocumentmeansanyworkcontainingtheDocumentoraportionofit,eithercopiedverbatim,orwithmodicationsand/ortranslatedintoanotherlanguage.A\SecondarySection"isanamedappendixorafront-mattersectionoftheDocumentthatdealsexclusivelywiththerelationshipofthepublishersorauthorsoftheDocumenttotheDocument'soverallsubject(ortorelatedmatters)andcontainsnothingthatcouldfalldirectlywithinthatoverallsubject.(Thus,iftheDocumentisinpartatextbookofmathematics,aSecondarySectionmaynotexplainanymathematics.)Therelationshipcouldbeamatterofhistoricalconnectionwiththesubjectorwithrelatedmatters,oroflegal,commercial,philosophical,ethicalorpoliticalpositionregardingthem.The\InvariantSections"arecertainSecondarySectionswhosetitlesaredesignated,asbeingthoseofInvariantSections,inthenoticethatsaysthattheDocumentisreleasedunderthisLicense.IfasectiondoesnotttheabovedenitionofSecondarythenitisnotallowedtobedesignatedasInvariant.TheDocumentmaycontainzeroInvariantSections.IftheDocumentdoesnotidentifyanyInvariantSectionsthentherearenone. AppendixA:Copyingthismanual62 The\CoverTexts"arecertainshortpassagesoftextthatarelisted,asFront-CoverTextsorBack-CoverTexts,inthenoticethatsaysthattheDocumentisreleasedunderthisLicense.AFront-CoverTextmaybeatmost5words,andaBack-CoverTextmaybeatmost25words.A\Transparent"copyoftheDocumentmeansamachine-readablecopy,representedinaformatwhosespecicationisavailabletothegeneralpublic,thatissuitableforrevisingthedocumentstraightforwardlywithgenerictexteditorsor(forimagescomposedofpixels)genericpaintprogramsor(fordrawings)somewidelyavailabledrawingeditor,andthatissuitableforinputtotextformattersorforautomatictranslationtoavarietyofformatssuitableforinputtotextformatters.AcopymadeinanotherwiseTransparentleformatwhosemarkup,orabsenceofmarkup,hasbeenarrangedtothwartordiscouragesubsequentmodicationbyreadersisnotTransparent.AnimageformatisnotTransparentifusedforanysubstantialamountoftext.Acopythatisnot\Transparent"iscalled\Opaque".ExamplesofsuitableformatsforTransparentcopiesincludeplainASCIIwithoutmarkup,Texinfoinputformat,LaTEXinputformat,SGMLorXMLusingapubliclyavailableDTD,andstandard-conformingsimpleHTML,PostScriptorPDFdesignedforhumanmodi-cation.ExamplesoftransparentimageformatsincludePNG,XCFandJPG.Opaqueformatsincludeproprietaryformatsthatcanbereadandeditedonlybyproprietarywordprocessors,SGMLorXMLforwhichtheDTDand/orprocessingtoolsarenotgenerallyavailable,andthemachine-generatedHTML,PostScriptorPDFproducedbysomewordprocessorsforoutputpurposesonly.The\TitlePage"means,foraprintedbook,thetitlepageitself,plussuchfollowingpagesasareneededtohold,legibly,thematerialthisLicenserequirestoappearinthetitlepage.Forworksinformatswhichdonothaveanytitlepageassuch,\TitlePage"meansthetextnearthemostprominentappearanceofthework'stitle,precedingthebeginningofthebodyofthetext.The\publisher"meansanypersonorentitythatdistributescopiesoftheDocumenttothepublic.Asection\EntitledXYZ"meansanamedsubunitoftheDocumentwhosetitleeitherispreciselyXYZorcontainsXYZinparenthesesfollowingtextthattranslatesXYZinanotherlanguage.(HereXYZstandsforaspecicsectionnamementionedbelow,suchas\Acknowledgements",\Dedications",\Endorsements",or\History".)To\PreservetheTitle"ofsuchasectionwhenyoumodifytheDocumentmeansthatitremainsasection\EntitledXYZ"accordingtothisdenition.TheDocumentmayincludeWarrantyDisclaimersnexttothenoticewhichstatesthatthisLicenseappliestotheDocument.TheseWarrantyDisclaimersareconsideredtobeincludedbyreferenceinthisLicense,butonlyasregardsdisclaimingwarranties:anyotherimplicationthattheseWarrantyDisclaimersmayhaveisvoidandhasnoeectonthemeaningofthisLicense.2.VERBATIMCOPYINGYoumaycopyanddistributetheDocumentinanymedium,eithercommerciallyornoncom-mercially,providedthatthisLicense,thecopyrightnotices,andthelicensenoticesayingthisLicenseappliestotheDocumentarereproducedinallcopies,andthatyouaddnootherconditionswhatsoevertothoseofthisLicense.Youmaynotusetechnicalmeasurestoobstructorcontrolthereadingorfurthercopyingofthecopiesyoumakeordistribute.However,youmayacceptcompensationinexchangeforcopies.Ifyoudistributealargeenoughnumberofcopiesyoumustalsofollowtheconditionsinsection3.Youmayalsolendcopies,underthesameconditionsstatedabove,andyoumaypubliclydisplaycopies. AppendixA:Copyingthismanual63 3.COPYINGINQUANTITYIfyoupublishprintedcopies(orcopiesinmediathatcommonlyhaveprintedcovers)oftheDocument,numberingmorethan100,andtheDocument'slicensenoticerequiresCoverTexts,youmustenclosethecopiesincoversthatcarry,clearlyandlegibly,alltheseCoverTexts:Front-CoverTextsonthefrontcover,andBack-CoverTextsonthebackcover.Bothcoversmustalsoclearlyandlegiblyidentifyyouasthepublisherofthesecopies.Thefrontcovermustpresentthefulltitlewithallwordsofthetitleequallyprominentandvisible.Youmayaddothermaterialonthecoversinaddition.Copyingwithchangeslimitedtothecovers,aslongastheypreservethetitleoftheDocumentandsatisfytheseconditions,canbetreatedasverbatimcopyinginotherrespects.Iftherequiredtextsforeithercoveraretoovoluminoustotlegibly,youshouldputtherstoneslisted(asmanyastreasonably)ontheactualcover,andcontinuetherestontoadjacentpages.IfyoupublishordistributeOpaquecopiesoftheDocumentnumberingmorethan100,youmusteitherincludeamachine-readableTransparentcopyalongwitheachOpaquecopy,orstateinorwitheachOpaquecopyacomputer-networklocationfromwhichthegeneralnetwork-usingpublichasaccesstodownloadusingpublic-standardnetworkprotocolsacompleteTransparentcopyoftheDocument,freeofaddedmaterial.Ifyouusethelatteroption,youmusttakereasonablyprudentsteps,whenyoubegindistributionofOpaquecopiesinquantity,toensurethatthisTransparentcopywillremainthusaccessibleatthestatedlocationuntilatleastoneyearafterthelasttimeyoudistributeanOpaquecopy(directlyorthroughyouragentsorretailers)ofthateditiontothepublic.Itisrequested,butnotrequired,thatyoucontacttheauthorsoftheDocumentwellbeforeredistributinganylargenumberofcopies,togivethemachancetoprovideyouwithanupdatedversionoftheDocument.4.MODIFICATIONSYoumaycopyanddistributeaModiedVersionoftheDocumentundertheconditionsofsections2and3above,providedthatyoureleasetheModiedVersionunderpreciselythisLicense,withtheModiedVersionllingtheroleoftheDocument,thuslicensingdistributionandmodicationoftheModiedVersiontowhoeverpossessesacopyofit.Inaddition,youmustdothesethingsintheModiedVersion:A.UseintheTitlePage(andonthecovers,ifany)atitledistinctfromthatoftheDocument,andfromthoseofpreviousversions(whichshould,iftherewereany,belistedintheHistorysectionoftheDocument).Youmayusethesametitleasapreviousversioniftheoriginalpublisherofthatversiongivespermission.B.ListontheTitlePage,asauthors,oneormorepersonsorentitiesresponsibleforauthorshipofthemodicationsintheModiedVersion,togetherwithatleastveoftheprincipalauthorsoftheDocument(allofitsprincipalauthors,ifithasfewerthanve),unlesstheyreleaseyoufromthisrequirement.C.StateontheTitlepagethenameofthepublisheroftheModiedVersion,asthepublisher.D.PreserveallthecopyrightnoticesoftheDocument.E.Addanappropriatecopyrightnoticeforyourmodicationsadjacenttotheothercopy-rightnotices.F.Include,immediatelyafterthecopyrightnotices,alicensenoticegivingthepublicpermissiontousetheModiedVersionunderthetermsofthisLicense,intheformshownintheAddendumbelow.G.PreserveinthatlicensenoticethefulllistsofInvariantSectionsandrequiredCoverTextsgivenintheDocument'slicensenotice. AppendixA:Copyingthismanual64 H.IncludeanunalteredcopyofthisLicense.I.PreservethesectionEntitled\History",PreserveitsTitle,andaddtoitanitemstatingatleastthetitle,year,newauthors,andpublisheroftheModiedVersionasgivenontheTitlePage.IfthereisnosectionEntitled\History"intheDocument,createonestatingthetitle,year,authors,andpublisheroftheDocumentasgivenonitsTitlePage,thenaddanitemdescribingtheModiedVersionasstatedintheprevioussentence.J.Preservethenetworklocation,ifany,givenintheDocumentforpublicaccesstoaTransparentcopyoftheDocument,andlikewisethenetworklocationsgivenintheDocumentforpreviousversionsitwasbasedon.Thesemaybeplacedinthe\History"section.YoumayomitanetworklocationforaworkthatwaspublishedatleastfouryearsbeforetheDocumentitself,oriftheoriginalpublisheroftheversionitreferstogivespermission.K.ForanysectionEntitled\Acknowledgements"or\Dedications",PreservetheTitleofthesection,andpreserveinthesectionallthesubstanceandtoneofeachofthecontributoracknowledgementsand/ordedicationsgiventherein.L.PreservealltheInvariantSectionsoftheDocument,unalteredintheirtextandintheirtitles.Sectionnumbersortheequivalentarenotconsideredpartofthesectiontitles.M.DeleteanysectionEntitled\Endorsements".SuchasectionmaynotbeincludedintheModiedVersion.N.DonotretitleanyexistingsectiontobeEntitled\Endorsements"ortocon ictintitlewithanyInvariantSection.O.PreserveanyWarrantyDisclaimers.IftheModiedVersionincludesnewfront-mattersectionsorappendicesthatqualifyasSecondarySectionsandcontainnomaterialcopiedfromtheDocument,youmayatyouroptiondesignatesomeorallofthesesectionsasinvariant.Todothis,addtheirtitlestothelistofInvariantSectionsintheModiedVersion'slicensenotice.Thesetitlesmustbedistinctfromanyothersectiontitles.YoumayaddasectionEntitled\Endorsements",provideditcontainsnothingbutendorse-mentsofyourModiedVersionbyvariousparties|forexample,statementsofpeerrevieworthatthetexthasbeenapprovedbyanorganizationastheauthoritativedenitionofastandard.YoumayaddapassageofuptovewordsasaFront-CoverText,andapassageofupto25wordsasaBack-CoverText,totheendofthelistofCoverTextsintheModiedVersion.OnlyonepassageofFront-CoverTextandoneofBack-CoverTextmaybeaddedby(orthrougharrangementsmadeby)anyoneentity.IftheDocumentalreadyincludesacovertextforthesamecover,previouslyaddedbyyouorbyarrangementmadebythesameentityyouareactingonbehalfof,youmaynotaddanother;butyoumayreplacetheoldone,onexplicitpermissionfromthepreviouspublisherthataddedtheoldone.Theauthor(s)andpublisher(s)oftheDocumentdonotbythisLicensegivepermissiontousetheirnamesforpublicityforortoassertorimplyendorsementofanyModiedVersion.5.COMBININGDOCUMENTSYoumaycombinetheDocumentwithotherdocumentsreleasedunderthisLicense,underthetermsdenedinsection4aboveformodiedversions,providedthatyouincludeinthecombinationalloftheInvariantSectionsofalloftheoriginaldocuments,unmodied,andlistthemallasInvariantSectionsofyourcombinedworkinitslicensenotice,andthatyoupreservealltheirWarrantyDisclaimers.ThecombinedworkneedonlycontainonecopyofthisLicense,andmultipleidenticalInvariantSectionsmaybereplacedwithasinglecopy.IftherearemultipleInvariant AppendixA:Copyingthismanual65 Sectionswiththesamenamebutdierentcontents,makethetitleofeachsuchsectionuniquebyaddingattheendofit,inparentheses,thenameoftheoriginalauthororpublisherofthatsectionifknown,orelseauniquenumber.MakethesameadjustmenttothesectiontitlesinthelistofInvariantSectionsinthelicensenoticeofthecombinedwork.Inthecombination,youmustcombineanysectionsEntitled\History"inthevariousoriginaldocuments,formingonesectionEntitled\History";likewisecombineanysectionsEntitled\Acknowledgements",andanysectionsEntitled\Dedications".YoumustdeleteallsectionsEntitled\Endorsements."6.COLLECTIONSOFDOCUMENTSYoumaymakeacollectionconsistingoftheDocumentandotherdocumentsreleasedunderthisLicense,andreplacetheindividualcopiesofthisLicenseinthevariousdocumentswithasinglecopythatisincludedinthecollection,providedthatyoufollowtherulesofthisLicenseforverbatimcopyingofeachofthedocumentsinallotherrespects.Youmayextractasingledocumentfromsuchacollection,anddistributeitindividuallyunderthisLicense,providedyouinsertacopyofthisLicenseintotheextracteddocument,andfollowthisLicenseinallotherrespectsregardingverbatimcopyingofthatdocument.7.AGGREGATIONWITHINDEPENDENTWORKSAcompilationoftheDocumentoritsderivativeswithotherseparateandindependentdocumentsorworks,inoronavolumeofastorageordistributionmedium,iscalledan\aggregate"ifthecopyrightresultingfromthecompilationisnotusedtolimitthelegalrightsofthecompilation'susersbeyondwhattheindividualworkspermit.WhentheDocumentisincludedinanaggregate,thisLicensedoesnotapplytotheotherworksintheaggregatewhicharenotthemselvesderivativeworksoftheDocument.IftheCoverTextrequirementofsection3isapplicabletothesecopiesoftheDocument,theniftheDocumentislessthanonehalfoftheentireaggregate,theDocument'sCoverTextsmaybeplacedoncoversthatbrackettheDocumentwithintheaggregate,ortheelectronicequivalentofcoversiftheDocumentisinelectronicform.Otherwisetheymustappearonprintedcoversthatbracketthewholeaggregate.8.TRANSLATIONTranslationisconsideredakindofmodication,soyoumaydistributetranslationsoftheDocumentunderthetermsofsection4.ReplacingInvariantSectionswithtranslationsrequiresspecialpermissionfromtheircopyrightholders,butyoumayincludetranslationsofsomeorallInvariantSectionsinadditiontotheoriginalversionsoftheseInvariantSections.YoumayincludeatranslationofthisLicense,andallthelicensenoticesintheDocument,andanyWarrantyDisclaimers,providedthatyoualsoincludetheoriginalEnglishversionofthisLicenseandtheoriginalversionsofthosenoticesanddisclaimers.IncaseofadisagreementbetweenthetranslationandtheoriginalversionofthisLicenseoranoticeordisclaimer,theoriginalversionwillprevail.IfasectionintheDocumentisEntitled\Acknowledgements",\Dedications",or\History",therequirement(section4)toPreserveitsTitle(section1)willtypicallyrequirechangingtheactualtitle.9.TERMINATIONYoumaynotcopy,modify,sublicense,ordistributetheDocumentexceptasexpresslypro-videdunderthisLicense.Anyattemptotherwisetocopy,modify,sublicense,ordistributeitisvoid,andwillautomaticallyterminateyourrightsunderthisLicense.However,ifyouceaseallviolationofthisLicense,thenyourlicensefromaparticularcopy-rightholderisreinstated(a)provisionally,unlessanduntilthecopyrightholderexplicitlyandnallyterminatesyourlicense,and(b)permanently,ifthecopyrightholderfailstonotifyyouoftheviolationbysomereasonablemeanspriorto60daysafterthecessation. AppendixA:Copyingthismanual66 Moreover,yourlicensefromaparticularcopyrightholderisreinstatedpermanentlyifthecopyrightholdernotiesyouoftheviolationbysomereasonablemeans,thisisthersttimeyouhavereceivednoticeofviolationofthisLicense(foranywork)fromthatcopyrightholder,andyoucuretheviolationpriorto30daysafteryourreceiptofthenotice.TerminationofyourrightsunderthissectiondoesnotterminatethelicensesofpartieswhohavereceivedcopiesorrightsfromyouunderthisLicense.Ifyourrightshavebeenterminatedandnotpermanentlyreinstated,receiptofacopyofsomeorallofthesamematerialdoesnotgiveyouanyrightstouseit.10.FUTUREREVISIONSOFTHISLICENSETheFreeSoftwareFoundationmaypublishnew,revisedversionsoftheGNUFreeDoc-umentationLicensefromtimetotime.Suchnewversionswillbesimilarinspirittothepresentversion,butmaydierindetailtoaddressnewproblemsorconcerns.See http://www.gnu.org/copyleft/ .EachversionoftheLicenseisgivenadistinguishingversionnumber.IftheDocumentspeciesthataparticularnumberedversionofthisLicense\oranylaterversion"appliestoit,youhavetheoptionoffollowingthetermsandconditionseitherofthatspeciedversionorofanylaterversionthathasbeenpublished(notasadraft)bytheFreeSoftwareFoundation.IftheDocumentdoesnotspecifyaversionnumberofthisLicense,youmaychooseanyversioneverpublished(notasadraft)bytheFreeSoftwareFoundation.IftheDocumentspeciesthataproxycandecidewhichfutureversionsofthisLicensecanbeused,thatproxy'spublicstatementofacceptanceofaversionpermanentlyauthorizesyoutochoosethatversionfortheDocument.11.RELICENSING\MassiveMultiauthorCollaborationSite"(or\MMCSite")meansanyWorldWideWebserverthatpublishescopyrightableworksandalsoprovidesprominentfacilitiesforanybodytoeditthoseworks.Apublicwikithatanybodycaneditisanexampleofsuchaserver.A\MassiveMultiauthorCollaboration"(or\MMC")containedinthesitemeansanysetofcopyrightableworksthuspublishedontheMMCsite.\CC-BY-SA"meanstheCreativeCommonsAttribution-ShareAlike3.0licensepublishedbyCreativeCommonsCorporation,anot-for-protcorporationwithaprincipalplaceofbusinessinSanFrancisco,California,aswellasfuturecopyleftversionsofthatlicensepublishedbythatsameorganization.\Incorporate"meanstopublishorrepublishaDocument,inwholeorinpart,aspartofanotherDocument.AnMMCis\eligibleforrelicensing"ifitislicensedunderthisLicense,andifallworksthatwererstpublishedunderthisLicensesomewhereotherthanthisMMC,andsubsequentlyincorporatedinwholeorinpartintotheMMC,(1)hadnocovertextsorinvariantsections,and(2)werethusincorporatedpriortoNovember1,2008.TheoperatorofanMMCSitemayrepublishanMMCcontainedinthesiteunderCC-BY-SAonthesamesiteatanytimebeforeAugust1,2009,providedtheMMCiseligibleforrelicensing. AppendixA:Copyingthismanual67 ADDENDUM:HowtousethisLicenseforyourdocumentsTousethisLicenseinadocumentyouhavewritten,includeacopyoftheLicenseinthedocumentandputthefollowingcopyrightandlicensenoticesjustafterthetitlepage:Copyright(C)yearyourname.Permissionisgrantedtocopy,distributeand/ormodifythisdocumentunderthetermsoftheGNUFreeDocumentationLicense,Version1.3oranylaterversionpublishedbytheFreeSoftwareFoundation;withnoInvariantSections,noFront-CoverTexts,andnoBack-CoverTexts.Acopyofthelicenseisincludedinthesectionentitled``GNUFreeDocumentationLicense''.IfyouhaveInvariantSections,Front-CoverTextsandBack-CoverTexts,replacethe\with...Texts."linewiththis:withtheInvariantSectionsbeinglisttheirtitles,withtheFront-CoverTextsbeinglist,andwiththeBack-CoverTextsbeinglist.IfyouhaveInvariantSectionswithoutCoverTexts,orsomeothercombinationofthethree,mergethosetwoalternativestosuitthesituation.Ifyourdocumentcontainsnontrivialexamplesofprogramcode,werecommendreleasingtheseexamplesinparallelunderyourchoiceoffreesoftwarelicense,suchastheGNUGeneralPublicLicense,topermittheiruseinfreesoftware. 68 ConceptIndex##wget::::::::::::::::::::::::::::::::::::::::::: 55 ..cssextension::::::::::::::::::::::::::::::::::::: 15 .htmlextension::::::::::::::::::::::::::::::::::: 15 .listingles,removing:::::::::::::::::::::::::::: 25 .netrc:::::::::::::::::::::::::::::::::::::::::::: 40 .wgetrc::::::::::::::::::::::::::::::::::::::::::: 40 Aacceptdirectories::::::::::::::::::::::::::::::::: 36 acceptsuxes:::::::::::::::::::::::::::::::::::: 34 acceptwildcards:::::::::::::::::::::::::::::::::: 34 appendtolog::::::::::::::::::::::::::::::::::::: 4 arguments::::::::::::::::::::::::::::::::::::::::: 2 authentication:::::::::::::::::::::::::::: 13 , 15 , 21 authenticationcredentials:::::::::::::::::::::::::: 7 Bbackingupconvertedles:::::::::::::::::::::::: 28 backinguples:::::::::::::::::::::::::::::::::::: 7 bandwidth,limit::::::::::::::::::::::::::::::::: 10 baseforrelativelinksininputle:::::::::::::::::: 5 bindaddress::::::::::::::::::::::::::::::::::::::: 6 bindDNSaddress::::::::::::::::::::::::::::::::: 6 bugreports::::::::::::::::::::::::::::::::::::::: 55 bugs::::::::::::::::::::::::::::::::::::::::::::: 55 Ccache::::::::::::::::::::::::::::::::::::::::::::: 16 cachingofDNSlookups:::::::::::::::::::::::::: 11 casefold::::::::::::::::::::::::::::::::::::::::: 31 clientDNSaddress:::::::::::::::::::::::::::::::: 6 clientIPaddress::::::::::::::::::::::::::::::::::: 6 clobbering,le::::::::::::::::::::::::::::::::::::: 6 commandline::::::::::::::::::::::::::::::::::::: 2 comments,html::::::::::::::::::::::::::::::::: 29 connecttimeout:::::::::::::::::::::::::::::::::: 10 ContentOnError:::::::::::::::::::::::::::::::: 20 Content-Disposition:::::::::::::::::::::::::::::: 20 Content-Encoding,choose:::::::::::::::::::::::: 18 Content-Length,ignore::::::::::::::::::::::::::: 17 continueretrieval::::::::::::::::::::::::::::::: 7 , 8 contributors:::::::::::::::::::::::::::::::::::::: 59 conversionoflinks:::::::::::::::::::::::::::::::: 27 cookies::::::::::::::::::::::::::::::::::::::::::: 16 cookies,loading:::::::::::::::::::::::::::::::::: 16 cookies,saving::::::::::::::::::::::::::::::::::: 17 cookies,session::::::::::::::::::::::::::::::::::: 17 cutdirectories:::::::::::::::::::::::::::::::::::: 14 Ddebug::::::::::::::::::::::::::::::::::::::::::::: 4 defaultpagename:::::::::::::::::::::::::::::::: 15 deleteafterretrieval:::::::::::::::::::::::::::::: 27 directories:::::::::::::::::::::::::::::::::::::::: 36 directories,exclude::::::::::::::::::::::::::::::: 36 directories,include::::::::::::::::::::::::::::::: 36 directorylimits::::::::::::::::::::::::::::::::::: 36 directoryprex::::::::::::::::::::::::::::::::::: 15 DNScache::::::::::::::::::::::::::::::::::::::: 11 DNSIPaddress,client,DNS::::::::::::::::::::::: 6 DNSserver:::::::::::::::::::::::::::::::::::::::: 6 DNStimeout::::::::::::::::::::::::::::::::::::: 10 dotstyle::::::::::::::::::::::::::::::::::::::::::: 8 downloadingmultipletimes:::::::::::::::::::::::: 6 EEGD::::::::::::::::::::::::::::::::::::::::::::: 23 entropy,specifyingsourceof:::::::::::::::::::::: 23 examples::::::::::::::::::::::::::::::::::::::::: 51 excludedirectories:::::::::::::::::::::::::::::::: 36 executewgetrccommand:::::::::::::::::::::::::: 3 FFDL,GNUFreeDocumentationLicense:::::::::: 61 features::::::::::::::::::::::::::::::::::::::::::: 1 lenames,restrict:::::::::::::::::::::::::::::::: 12 lepermissions::::::::::::::::::::::::::::::::::: 26 llingproxycache:::::::::::::::::::::::::::::::: 27 followFTPlinks::::::::::::::::::::::::::::::::: 30 followingftplinks:::::::::::::::::::::::::::::::: 37 followinglinks:::::::::::::::::::::::::::::::::::: 34 forcehtml::::::::::::::::::::::::::::::::::::::::: 5 ftpauthentication:::::::::::::::::::::::::::::::: 25 ftppassword::::::::::::::::::::::::::::::::::::: 25 ftptime-stamping:::::::::::::::::::::::::::::::: 39 ftpuser:::::::::::::::::::::::::::::::::::::::::: 25 Gglobbing,toggle:::::::::::::::::::::::::::::::::: 26 Hhangup::::::::::::::::::::::::::::::::::::::::::: 57 header,add:::::::::::::::::::::::::::::::::::::: 17 hosts,spanning::::::::::::::::::::::::::::::::::: 34 HSTS:::::::::::::::::::::::::::::::::::::::::::: 23 htmlcomments:::::::::::::::::::::::::::::::::: 29 httppassword:::::::::::::::::::::::::::::::::::: 15 httpreferer::::::::::::::::::::::::::::::::::::::: 18 httptime-stamping::::::::::::::::::::::::::::::: 39 httpuser::::::::::::::::::::::::::::::::::::::::: 15 ConceptIndex69 Iidnsupport:::::::::::::::::::::::::::::::::::::: 13 ignorecase::::::::::::::::::::::::::::::::::::::: 31 ignorelength::::::::::::::::::::::::::::::::::::: 17 includedirectories:::::::::::::::::::::::::::::::: 36 incompletedownloads::::::::::::::::::::::::::: 7 , 8 incrementalupdating::::::::::::::::::::::::::::: 38 index.html::::::::::::::::::::::::::::::::::::::: 15 input-le:::::::::::::::::::::::::::::::::::::::::: 4 input-metalink:::::::::::::::::::::::::::::::::::: 5 InternetRelayChat:::::::::::::::::::::::::::::: 55 invoking::::::::::::::::::::::::::::::::::::::::::: 2 IPaddress,client:::::::::::::::::::::::::::::::::: 6 IPv6::::::::::::::::::::::::::::::::::::::::::::: 12 IRC:::::::::::::::::::::::::::::::::::::::::::::: 55 irisupport::::::::::::::::::::::::::::::::::::::: 13 KKeep-Alive,turningo::::::::::::::::::::::::::: 16 keep-badhash:::::::::::::::::::::::::::::::::::::: 5 Llatestversion::::::::::::::::::::::::::::::::::::: 55 limitbandwidth:::::::::::::::::::::::::::::::::: 10 linkconversion::::::::::::::::::::::::::::::::::: 27 links::::::::::::::::::::::::::::::::::::::::::::: 34 list::::::::::::::::::::::::::::::::::::::::::::::: 55 loadingcookies::::::::::::::::::::::::::::::::::: 16 localencoding:::::::::::::::::::::::::::::::::::: 13 locationofwgetrc:::::::::::::::::::::::::::::::: 40 logle::::::::::::::::::::::::::::::::::::::::::::: 4 Mmailinglist::::::::::::::::::::::::::::::::::::::: 55 metalink-index:::::::::::::::::::::::::::::::::::: 5 metalink-over-http::::::::::::::::::::::::::::::::: 5 mirroring::::::::::::::::::::::::::::::::::::::::: 52 Nnoparent:::::::::::::::::::::::::::::::::::::::: 36 no-clobber::::::::::::::::::::::::::::::::::::::::: 6 nohup::::::::::::::::::::::::::::::::::::::::::::: 2 numberoftries:::::::::::::::::::::::::::::::::::: 6 Ooset:::::::::::::::::::::::::::::::::::::::::::::: 8 operatingsystems:::::::::::::::::::::::::::::::: 56 optionsyntax:::::::::::::::::::::::::::::::::::::: 3 OtherHTTPMethods:::::::::::::::::::::::::::: 20 outputle::::::::::::::::::::::::::::::::::::::::: 4 overview::::::::::::::::::::::::::::::::::::::::::: 1 Ppagerequisites::::::::::::::::::::::::::::::::::: 28 passiveftp::::::::::::::::::::::::::::::::::::::: 26 password::::::::::::::::::::::::::::::::::::::::: 13 pause:::::::::::::::::::::::::::::::::::::::::::: 10 PersistentConnections,disabling::::::::::::::::: 16 portability::::::::::::::::::::::::::::::::::::::: 56 POST:::::::::::::::::::::::::::::::::::::::::::: 19 preferred-location:::::::::::::::::::::::::::::::::: 5 progressindicator:::::::::::::::::::::::::::::::::: 8 proxies::::::::::::::::::::::::::::::::::::::::::: 54 proxy::::::::::::::::::::::::::::::::::::::::: 11 , 16 proxyauthentication::::::::::::::::::::::::::::: 18 proxylling:::::::::::::::::::::::::::::::::::::: 27 proxypassword::::::::::::::::::::::::::::::::::: 18 proxyuser:::::::::::::::::::::::::::::::::::::::: 18 Qquiet:::::::::::::::::::::::::::::::::::::::::::::: 4 quota:::::::::::::::::::::::::::::::::::::::::::: 11 Rrandomwait::::::::::::::::::::::::::::::::::::: 11 randomness,specifyingsourceof:::::::::::::::::: 23 rate,limit:::::::::::::::::::::::::::::::::::::::: 10 readtimeout::::::::::::::::::::::::::::::::::::: 10 recursion::::::::::::::::::::::::::::::::::::::::: 33 recursivedownload::::::::::::::::::::::::::::::: 33 redirect:::::::::::::::::::::::::::::::::::::::::: 18 redirectingoutput:::::::::::::::::::::::::::::::: 52 referer,http:::::::::::::::::::::::::::::::::::::: 18 rejectdirectories:::::::::::::::::::::::::::::::::: 36 rejectsuxes::::::::::::::::::::::::::::::::::::: 35 rejectwildcards:::::::::::::::::::::::::::::::::: 35 relativelinks::::::::::::::::::::::::::::::::::::: 37 remoteencoding:::::::::::::::::::::::::::::::::: 14 reportingbugs:::::::::::::::::::::::::::::::::::: 55 requiredimages,downloading::::::::::::::::::::: 28 resumedownload:::::::::::::::::::::::::::::::: 7 , 8 retries::::::::::::::::::::::::::::::::::::::::::::: 6 retries,waitingbetween::::::::::::::::::::::::::: 11 retrieving:::::::::::::::::::::::::::::::::::::::: 33 robotexclusion::::::::::::::::::::::::::::::::::: 58 robots.txt:::::::::::::::::::::::::::::::::::::::: 58 Ssamplewgetrc:::::::::::::::::::::::::::::::::::: 47 savingcookies:::::::::::::::::::::::::::::::::::: 17 security:::::::::::::::::::::::::::::::::::::::::: 59 servermaintenance::::::::::::::::::::::::::::::: 58 serverresponse,print:::::::::::::::::::::::::::::: 9 serverresponse,save:::::::::::::::::::::::::::::: 18 sessioncookies::::::::::::::::::::::::::::::::::: 17 signalhandling::::::::::::::::::::::::::::::::::: 57 spanninghosts::::::::::::::::::::::::::::::::::: 34 specifycong:::::::::::::::::::::::::::::::::::::: 5 spider::::::::::::::::::::::::::::::::::::::::::::: 9 SSL:::::::::::::::::::::::::::::::::::::::::::::: 21 SSLcerticate:::::::::::::::::::::::::::::::::::: 22 SSLcerticateauthority:::::::::::::::::::::::::: 22 SSLcerticatetype,specify:::::::::::::::::::::: 22 ConceptIndex70 SSLcerticate,check::::::::::::::::::::::::::::: 22 SSLCRL,certicaterevocationlist::::::::::::::: 23 SSLprotocol,choose::::::::::::::::::::::::::::: 21 SSLPublicKeyPin:::::::::::::::::::::::::::::: 23 startposition:::::::::::::::::::::::::::::::::::::: 8 startup::::::::::::::::::::::::::::::::::::::::::: 40 startuple::::::::::::::::::::::::::::::::::::::: 40 suxes,accept::::::::::::::::::::::::::::::::::: 34 suxes,reject:::::::::::::::::::::::::::::::::::: 35 symboliclinks,retrieving::::::::::::::::::::::::: 26 syntaxofoptions:::::::::::::::::::::::::::::::::: 3 syntaxofwgetrc:::::::::::::::::::::::::::::::::: 40 Ttag-basedrecursivepruning::::::::::::::::::::::: 30 time-stamping:::::::::::::::::::::::::::::::::::: 38 time-stampingusage:::::::::::::::::::::::::::::: 38 timeout:::::::::::::::::::::::::::::::::::::::::: 10 timeout,connect::::::::::::::::::::::::::::::::: 10 timeout,DNS:::::::::::::::::::::::::::::::::::: 10 timeout,read::::::::::::::::::::::::::::::::::::: 10 timestamping::::::::::::::::::::::::::::::::::::: 38 tries::::::::::::::::::::::::::::::::::::::::::::::: 6 Trustservernames::::::::::::::::::::::::::::::: 21 typesofles:::::::::::::::::::::::::::::::::::::: 34 Uunlink:::::::::::::::::::::::::::::::::::::::::::: 14 updatingthearchives::::::::::::::::::::::::::::: 38 URL:::::::::::::::::::::::::::::::::::::::::::::: 2 URLsyntax::::::::::::::::::::::::::::::::::::::: 2 usage,time-stamping::::::::::::::::::::::::::::: 38 user:::::::::::::::::::::::::::::::::::::::::::::: 13 user-agent:::::::::::::::::::::::::::::::::::::::: 18 Vvarious::::::::::::::::::::::::::::::::::::::::::: 54 verbose:::::::::::::::::::::::::::::::::::::::::::: 4 Wwait:::::::::::::::::::::::::::::::::::::::::::::: 10 wait,random::::::::::::::::::::::::::::::::::::: 11 waitingbetweenretries::::::::::::::::::::::::::: 11 WARC::::::::::::::::::::::::::::::::::::::::::: 24 website:::::::::::::::::::::::::::::::::::::::::: 55 Wgetasspider:::::::::::::::::::::::::::::::::::: 9 wgetrc::::::::::::::::::::::::::::::::::::::::::: 40 wgetrccommands:::::::::::::::::::::::::::::::: 40 wgetrclocation::::::::::::::::::::::::::::::::::: 40 wgetrcsyntax:::::::::::::::::::::::::::::::::::: 40 wildcards,accept::::::::::::::::::::::::::::::::: 34 wildcards,reject:::::::::::::::::::::::::::::::::: 35 Windowslenames:::::::::::::::::::::::::::::: 12 iii TableofContents1Overview:::::::::::::::::::::::::::::::::::::::::::::::::::::::: 1 2Invoking::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 2 2.1URLFormat::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 2 2.2OptionSyntax::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 3 2.3BasicStartupOptions::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 3 2.4LoggingandInputFileOptions:::::::::::::::::::::::::::::::::::::::::::::::::::: 4 2.5DownloadOptions::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 6 2.6DirectoryOptions:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 14 2.7HTTPOptions::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 15 2.8HTTPS(SSL/TLS)Options:::::::::::::::::::::::::::::::::::::::::::::::::::::: 21 2.9FTPOptions::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 25 2.10FTPSOptions::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 26 2.11RecursiveRetrievalOptions:::::::::::::::::::::::::::::::::::::::::::::::::::::: 27 2.12RecursiveAccept/RejectOptions:::::::::::::::::::::::::::::::::::::::::::::::: 30 2.13ExitStatus:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 31 3RecursiveDownload:::::::::::::::::::::::::::::::::::::::::: 33 4FollowingLinks::::::::::::::::::::::::::::::::::::::::::::::: 34 4.1SpanningHosts::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 34 4.2TypesofFiles:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 34 4.3Directory-BasedLimits::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 36 4.4RelativeLinks:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 37 4.5FollowingFTPLinks::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 37 5Time-Stamping:::::::::::::::::::::::::::::::::::::::::::::::: 38 5.1Time-StampingUsage:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 38 5.2HTTPTime-StampingInternals:::::::::::::::::::::::::::::::::::::::::::::::::: 39 5.3FTPTime-StampingInternals:::::::::::::::::::::::::::::::::::::::::::::::::::: 39 6StartupFile::::::::::::::::::::::::::::::::::::::::::::::::::: 40 6.1WgetrcLocation:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 40 6.2WgetrcSyntax::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 40 6.3WgetrcCommands::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 40 6.4SampleWgetrc::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 47 7Examples:::::::::::::::::::::::::::::::::::::::::::::::::::::: 51 7.1SimpleUsage::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 51 7.2AdvancedUsage:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 51 7.3VeryAdvancedUsage::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 52 iv 8Various::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 54 8.1Proxies::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 54 8.2Distribution:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 55 8.3WebSite::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 55 8.4MailingLists::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 55 PrimaryList:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 55 ObsoleteLists:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 55 8.5InternetRelayChat:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 55 8.6ReportingBugs::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 55 8.7Portability:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 56 8.8Signals::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 57 9Appendices:::::::::::::::::::::::::::::::::::::::::::::::::::: 58 9.1RobotExclusion:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 58 9.2SecurityConsiderations::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 59 9.3Contributors:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 59 AppendixACopyingthismanual:::::::::::::::::::::::::::::: 61 A.1GNUFreeDocumentationLicense:::::::::::::::::::::::::::::::::::::::::::::::: 61 ConceptIndex:::::::::::::::::::::::::::::::::::::::::::::::::::: 68