curl.1 167 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726
  1. .\" **************************************************************************
  2. .\" * _ _ ____ _
  3. .\" * Project ___| | | | _ \| |
  4. .\" * / __| | | | |_) | |
  5. .\" * | (__| |_| | _ <| |___
  6. .\" * \___|\___/|_| \_\_____|
  7. .\" *
  8. .\" * Copyright (C) 1998 \- 2021, Daniel Stenberg, <[email protected]>, et al.
  9. .\" *
  10. .\" * This software is licensed as described in the file COPYING, which
  11. .\" * you should have received as part of this distribution. The terms
  12. .\" * are also available at https://curl.se/docs/copyright.html.
  13. .\" *
  14. .\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
  15. .\" * copies of the Software, and permit persons to whom the Software is
  16. .\" * furnished to do so, under the terms of the COPYING file.
  17. .\" *
  18. .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  19. .\" * KIND, either express or implied.
  20. .\" *
  21. .\" **************************************************************************
  22. .\"
  23. .\" DO NOT EDIT. Generated by the curl project gen.pl man page generator.
  24. .\"
  25. .TH curl 1 "November 10 2021" "curl 7.80.0" "curl Manual"
  26. .SH NAME
  27. curl \- transfer a URL
  28. .SH SYNOPSIS
  29. .B curl [options / URLs]
  30. .SH DESCRIPTION
  31. \fBcurl\fP is a tool for transferring data from or to a server. It supports these
  32. protocols: DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, HTTPS, IMAP, IMAPS,
  33. LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, SMB, SMBS, SMTP,
  34. SMTPS, TELNET or TFTP. The command is designed to work without user
  35. interaction.
  36. curl offers a busload of useful tricks like proxy support, user
  37. authentication, FTP upload, HTTP post, SSL connections, cookies, file transfer
  38. resume and more. As you will see below, the number of features will make your
  39. head spin!
  40. curl is powered by libcurl for all transfer-related features. See
  41. \fIlibcurl(3)\fP for details.
  42. .SH URL
  43. The URL syntax is protocol-dependent. You find a detailed description in
  44. RFC 3986.
  45. You can specify multiple URLs or parts of URLs by writing part sets within
  46. braces and quoting the URL as in:
  47. "http://site.{one,two,three}.com"
  48. or you can get sequences of alphanumeric series by using [] as in:
  49. "ftp://ftp.example.com/file[1-100].txt"
  50. "ftp://ftp.example.com/file[001-100].txt" (with leading zeros)
  51. "ftp://ftp.example.com/file[a-z].txt"
  52. Nested sequences are not supported, but you can use several ones next to each
  53. other:
  54. "http://example.com/archive[1996-1999]/vol[1-4]/part{a,b,c}.html"
  55. You can specify any amount of URLs on the command line. They will be fetched
  56. in a sequential manner in the specified order. You can specify command line
  57. options and URLs mixed and in any order on the command line.
  58. You can specify a step counter for the ranges to get every Nth number or
  59. letter:
  60. "http://example.com/file[1-100:10].txt"
  61. "http://example.com/file[a-z:2].txt"
  62. When using [] or {} sequences when invoked from a command line prompt, you
  63. probably have to put the full URL within double quotes to avoid the shell from
  64. interfering with it. This also goes for other characters treated special, like
  65. for example \(aq&', '?' and '*'.
  66. Provide the IPv6 zone index in the URL with an escaped percentage sign and the
  67. interface name. Like in
  68. "http://[fe80::3%25eth0]/"
  69. If you specify URL without protocol:// prefix, curl will attempt to guess what
  70. protocol you might want. It will then default to HTTP but try other protocols
  71. based on often-used host name prefixes. For example, for host names starting
  72. with "ftp." curl will assume you want to speak FTP.
  73. curl will do its best to use what you pass to it as a URL. It is not trying to
  74. validate it as a syntactically correct URL by any means but is instead
  75. \fBvery\fP liberal with what it accepts.
  76. curl will attempt to re-use connections for multiple file transfers, so that
  77. getting many files from the same server will not do multiple connects /
  78. handshakes. This improves speed. Of course this is only done on files
  79. specified on a single command line and cannot be used between separate curl
  80. invocations.
  81. .SH OUTPUT
  82. If not told otherwise, curl writes the received data to stdout. It can be
  83. instructed to instead save that data into a local file, using the \fI\-o, \-\-output\fP or
  84. \fI\-O, \-\-remote-name\fP options. If curl is given multiple URLs to transfer on the
  85. command line, it similarly needs multiple options for where to save them.
  86. curl does not parse or otherwise "understand" the content it gets or writes as
  87. output. It does no encoding or decoding, unless explicitly asked to with
  88. dedicated command line options.
  89. .SH PROTOCOLS
  90. curl supports numerous protocols, or put in URL terms: schemes. Your
  91. particular build may not support them all.
  92. .IP DICT
  93. Lets you lookup words using online dictionaries.
  94. .IP FILE
  95. Read or write local files. curl does not support accessing file:// URL
  96. remotely, but when running on Microsoft Windows using the native UNC approach
  97. will work.
  98. .IP FTP(S)
  99. curl supports the File Transfer Protocol with a lot of tweaks and levers. With
  100. or without using TLS.
  101. .IP GOPHER(S)
  102. Retrieve files.
  103. .IP HTTP(S)
  104. curl supports HTTP with numerous options and variations. It can speak HTTP
  105. version 0.9, 1.0, 1.1, 2 and 3 depending on build options and the correct
  106. command line options.
  107. .IP IMAP(S)
  108. Using the mail reading protocol, curl can "download" emails for you. With or
  109. without using TLS.
  110. .IP LDAP(S)
  111. curl can do directory lookups for you, with or without TLS.
  112. .IP MQTT
  113. curl supports MQTT version 3. Downloading over MQTT equals "subscribe" to a
  114. topic while uploading/posting equals "publish" on a topic. MQTT over TLS is
  115. not supported (yet).
  116. .IP POP3(S)
  117. Downloading from a pop3 server means getting a mail. With or without using
  118. TLS.
  119. .IP RTMP(S)
  120. The Realtime Messaging Protocol is primarily used to server streaming media
  121. and curl can download it.
  122. .IP RTSP
  123. curl supports RTSP 1.0 downloads.
  124. .IP SCP
  125. curl supports SSH version 2 scp transfers.
  126. .IP SFTP
  127. curl supports SFTP (draft 5) done over SSH version 2.
  128. .IP SMB(S)
  129. curl supports SMB version 1 for upload and download.
  130. .IP SMTP(S)
  131. Uploading contents to an SMTP server means sending an email. With or without
  132. TLS.
  133. .IP TELNET
  134. Telling curl to fetch a telnet URL starts an interactive session where it
  135. sends what it reads on stdin and outputs what the server sends it.
  136. .IP TFTP
  137. curl can do TFTP downloads and uploads.
  138. .SH "PROGRESS METER"
  139. curl normally displays a progress meter during operations, indicating the
  140. amount of transferred data, transfer speeds and estimated time left, etc. The
  141. progress meter displays number of bytes and the speeds are in bytes per
  142. second. The suffixes (k, M, G, T, P) are 1024 based. For example 1k is 1024
  143. bytes. 1M is 1048576 bytes.
  144. curl displays this data to the terminal by default, so if you invoke curl to
  145. do an operation and it is about to write data to the terminal, it
  146. \fIdisables\fP the progress meter as otherwise it would mess up the output
  147. mixing progress meter and response data.
  148. If you want a progress meter for HTTP POST or PUT requests, you need to
  149. redirect the response output to a file, using shell redirect (>), \fI\-o, \-\-output\fP or
  150. similar.
  151. This does not apply to FTP upload as that operation does not spit out any
  152. response data to the terminal.
  153. If you prefer a progress "bar" instead of the regular meter, \fI\-#, \-\-progress-bar\fP is
  154. your friend. You can also disable the progress meter completely with the
  155. \fI\-s, \-\-silent\fP option.
  156. .SH OPTIONS
  157. Options start with one or two dashes. Many of the options require an
  158. additional value next to them.
  159. The short "single-dash" form of the options, \-d for example, may be used with
  160. or without a space between it and its value, although a space is a recommended
  161. separator. The long "double-dash" form, \fI\-d, \-\-data\fP for example, requires a space
  162. between it and its value.
  163. Short version options that do not need any additional values can be used
  164. immediately next to each other, like for example you can specify all the
  165. options \-O, \-L and \-v at once as \-OLv.
  166. In general, all boolean options are enabled with \-\-\fBoption\fP and yet again
  167. disabled with \-\-\fBno-\fPoption. That is, you use the exact same option name
  168. but prefix it with "no-". However, in this list we mostly only list and show
  169. the \-\-option version of them.
  170. .IP "\-\-abstract-unix-socket <path>"
  171. (HTTP) Connect through an abstract Unix domain socket, instead of using the network.
  172. Note: netstat shows the path of an abstract socket prefixed with \(aq@', however
  173. the <path> argument should not have this leading character.
  174. Example:
  175. .nf
  176. curl --abstract-unix-socket socketpath https://example.com
  177. .fi
  178. Added in 7.53.0.
  179. .IP "\-\-alt-svc <file name>"
  180. (HTTPS) This option enables the alt-svc parser in curl. If the file name points to an
  181. existing alt-svc cache file, that will be used. After a completed transfer,
  182. the cache will be saved to the file name again if it has been modified.
  183. Specify a "" file name (zero length) to avoid loading/saving and make curl
  184. just handle the cache in memory.
  185. If this option is used several times, curl will load contents from all the
  186. files but the last one will be used for saving.
  187. Example:
  188. .nf
  189. curl --alt-svc svc.txt https://example.com
  190. .fi
  191. Added in 7.64.1.
  192. .IP "\-\-anyauth"
  193. (HTTP) Tells curl to figure out authentication method by itself, and use the most
  194. secure one the remote site claims to support. This is done by first doing a
  195. request and checking the response-headers, thus possibly inducing an extra
  196. network round-trip. This is used instead of setting a specific authentication
  197. method, which you can do with \fI\-\-basic\fP, \fI\-\-digest\fP, \fI\-\-ntlm\fP, and \fI\-\-negotiate\fP.
  198. Using \fI\-\-anyauth\fP is not recommended if you do uploads from stdin, since it may
  199. require data to be sent twice and then the client must be able to rewind. If
  200. the need should arise when uploading from stdin, the upload operation will
  201. fail.
  202. Used together with \fI\-u, \-\-user\fP.
  203. Example:
  204. .nf
  205. curl --anyauth --user me:pwd https://example.com
  206. .fi
  207. See also \fI--proxy-anyauth\fP, \fI--basic\fP and \fI--digest\fP.
  208. .IP "\-a, \-\-append"
  209. (FTP SFTP) When used in an upload, this makes curl append to the target file instead of
  210. overwriting it. If the remote file does not exist, it will be created. Note
  211. that this flag is ignored by some SFTP servers (including OpenSSH).
  212. Example:
  213. .nf
  214. curl --upload-file local --append ftp://example.com/
  215. .fi
  216. .IP "\-\-aws-sigv4 <provider1[:provider2[:region[:service]]]>"
  217. Use AWS V4 signature authentication in the transfer.
  218. The provider argument is a string that is used by the algorithm when creating
  219. outgoing authentication headers.
  220. The region argument is a string that points to a geographic area of
  221. a resources collection (region-code) when the region name is omitted from
  222. the endpoint.
  223. The service argument is a string that points to a function provided by a cloud
  224. (service-code) when the service name is omitted from the endpoint.
  225. Example:
  226. .nf
  227. curl --aws-sigv4 "aws:amz:east-2:es" --user "key:secret" https://example.com
  228. .fi
  229. Added in 7.75.0.
  230. .IP "\-\-basic"
  231. (HTTP) Tells curl to use HTTP Basic authentication with the remote host. This is the
  232. default and this option is usually pointless, unless you use it to override a
  233. previously set option that sets a different authentication method (such as
  234. \fI\-\-ntlm\fP, \fI\-\-digest\fP, or \fI\-\-negotiate\fP).
  235. Used together with \fI\-u, \-\-user\fP.
  236. Example:
  237. .nf
  238. curl -u name:password --basic https://example.com
  239. .fi
  240. See also \fI--proxy-basic\fP.
  241. .IP "\-\-cacert <file>"
  242. (TLS) Tells curl to use the specified certificate file to verify the peer. The file
  243. may contain multiple CA certificates. The certificate(s) must be in PEM
  244. format. Normally curl is built to use a default file for this, so this option
  245. is typically used to alter that default file.
  246. curl recognizes the environment variable named \(aqCURL_CA_BUNDLE' if it is
  247. set, and uses the given path as a path to a CA cert bundle. This option
  248. overrides that variable.
  249. The windows version of curl will automatically look for a CA certs file named
  250. \(aqcurl-ca-bundle.crt', either in the same directory as curl.exe, or in the
  251. Current Working Directory, or in any folder along your PATH.
  252. If curl is built against the NSS SSL library, the NSS PEM PKCS#11 module
  253. (libnsspem.so) needs to be available for this option to work properly.
  254. (iOS and macOS only) If curl is built against Secure Transport, then this
  255. option is supported for backward compatibility with other SSL engines, but it
  256. should not be set. If the option is not set, then curl will use the
  257. certificates in the system and user Keychain to verify the peer, which is the
  258. preferred method of verifying the peer\(aqs certificate chain.
  259. (Schannel only) This option is supported for Schannel in Windows 7 or later
  260. with libcurl 7.60 or later. This option is supported for backward
  261. compatibility with other SSL engines; instead it is recommended to use
  262. Windows\(aq store of root certificates (the default for Schannel).
  263. If this option is used several times, the last one will be used.
  264. Example:
  265. .nf
  266. curl --cacert CA-file.txt https://example.com
  267. .fi
  268. .IP "\-\-capath <dir>"
  269. (TLS) Tells curl to use the specified certificate directory to verify the
  270. peer. Multiple paths can be provided by separating them with ":" (e.g.
  271. \&"path1:path2:path3"). The certificates must be in PEM format, and if curl is
  272. built against OpenSSL, the directory must have been processed using the
  273. c_rehash utility supplied with OpenSSL. Using \fI\-\-capath\fP can allow
  274. OpenSSL-powered curl to make SSL-connections much more efficiently than using
  275. \fI\-\-cacert\fP if the \-\-cacert file contains many CA certificates.
  276. If this option is set, the default capath value will be ignored, and if it is
  277. used several times, the last one will be used.
  278. Example:
  279. .nf
  280. curl --capath /local/directory https://example.com
  281. .fi
  282. .IP "\-\-cert-status"
  283. (TLS) Tells curl to verify the status of the server certificate by using the
  284. Certificate Status Request (aka. OCSP stapling) TLS extension.
  285. If this option is enabled and the server sends an invalid (e.g. expired)
  286. response, if the response suggests that the server certificate has been revoked,
  287. or no response at all is received, the verification fails.
  288. This is currently only implemented in the OpenSSL, GnuTLS and NSS backends.
  289. Example:
  290. .nf
  291. curl --cert-status https://example.com
  292. .fi
  293. Added in 7.41.0.
  294. .IP "\-\-cert-type <type>"
  295. (TLS) Tells curl what type the provided client certificate is using. PEM, DER, ENG
  296. and P12 are recognized types. If not specified, PEM is assumed.
  297. If this option is used several times, the last one will be used.
  298. Example:
  299. .nf
  300. curl --cert-type PEM --cert file https://example.com
  301. .fi
  302. See also \fI-E, --cert\fP, \fI--key\fP and \fI--key-type\fP.
  303. .IP "\-E, \-\-cert <certificate[:password]>"
  304. (TLS) Tells curl to use the specified client certificate file when getting a file
  305. with HTTPS, FTPS or another SSL-based protocol. The certificate must be in
  306. PKCS#12 format if using Secure Transport, or PEM format if using any other
  307. engine. If the optional password is not specified, it will be queried for on
  308. the terminal. Note that this option assumes a \&"certificate" file that is the
  309. private key and the client certificate concatenated! See \fI\-E, \-\-cert\fP and \fI\-\-key\fP to
  310. specify them independently.
  311. If curl is built against the NSS SSL library then this option can tell
  312. curl the nickname of the certificate to use within the NSS database defined
  313. by the environment variable SSL_DIR (or by default /etc/pki/nssdb). If the
  314. NSS PEM PKCS#11 module (libnsspem.so) is available then PEM files may be
  315. loaded. If you want to use a file from the current directory, please precede
  316. it with "./" prefix, in order to avoid confusion with a nickname. If the
  317. nickname contains ":", it needs to be preceded by "\\" so that it is not
  318. recognized as password delimiter. If the nickname contains "\\", it needs to
  319. be escaped as "\\\\" so that it is not recognized as an escape character.
  320. If curl is built against OpenSSL library, and the engine pkcs11 is available,
  321. then a PKCS#11 URI (RFC 7512) can be used to specify a certificate located in
  322. a PKCS#11 device. A string beginning with "pkcs11:" will be interpreted as a
  323. PKCS#11 URI. If a PKCS#11 URI is provided, then the \fI\-\-engine\fP option will be set
  324. as "pkcs11" if none was provided and the \fI\-\-cert-type\fP option will be set as
  325. "ENG" if none was provided.
  326. (iOS and macOS only) If curl is built against Secure Transport, then the
  327. certificate string can either be the name of a certificate/private key in the
  328. system or user keychain, or the path to a PKCS#12-encoded certificate and
  329. private key. If you want to use a file from the current directory, please
  330. precede it with "./" prefix, in order to avoid confusion with a nickname.
  331. (Schannel only) Client certificates must be specified by a path
  332. expression to a certificate store. (Loading PFX is not supported; you can
  333. import it to a store first). You can use
  334. "<store location>\\<store name>\\<thumbprint>" to refer to a certificate
  335. in the system certificates store, for example,
  336. "CurrentUser\\MY\\934a7ac6f8a5d579285a74fa61e19f23ddfe8d7a". Thumbprint is
  337. usually a SHA-1 hex string which you can see in certificate details. Following
  338. store locations are supported: CurrentUser, LocalMachine, CurrentService,
  339. Services, CurrentUserGroupPolicy, LocalMachineGroupPolicy,
  340. LocalMachineEnterprise.
  341. If this option is used several times, the last one will be used.
  342. Example:
  343. .nf
  344. curl --cert certfile --key keyfile https://example.com
  345. .fi
  346. See also \fI--cert-type\fP, \fI--key\fP and \fI--key-type\fP.
  347. .IP "\-\-ciphers <list of ciphers>"
  348. (TLS) Specifies which ciphers to use in the connection. The list of ciphers must
  349. specify valid ciphers. Read up on SSL cipher list details on this URL:
  350. https://curl.se/docs/ssl-ciphers.html
  351. If this option is used several times, the last one will be used.
  352. Example:
  353. .nf
  354. curl --ciphers ECDHE-ECDSA-AES256-CCM8 https://example.com
  355. .fi
  356. .IP "\-\-compressed-ssh"
  357. (SCP SFTP) Enables built-in SSH compression.
  358. This is a request, not an order; the server may or may not do it.
  359. Example:
  360. .nf
  361. curl --compressed-ssh sftp://example.com/
  362. .fi
  363. Added in 7.56.0.
  364. .IP "\-\-compressed"
  365. (HTTP) Request a compressed response using one of the algorithms curl supports, and
  366. automatically decompress the content. Headers are not modified.
  367. If this option is used and the server sends an unsupported encoding, curl will
  368. report an error. This is a request, not an order; the server may or may not
  369. deliver data compressed.
  370. Example:
  371. .nf
  372. curl --compressed https://example.com
  373. .fi
  374. .IP "\-K, \-\-config <file>"
  375. Specify a text file to read curl arguments from. The command line arguments
  376. found in the text file will be used as if they were provided on the command
  377. line.
  378. Options and their parameters must be specified on the same line in the file,
  379. separated by whitespace, colon, or the equals sign. Long option names can
  380. optionally be given in the config file without the initial double dashes and
  381. if so, the colon or equals characters can be used as separators. If the option
  382. is specified with one or two dashes, there can be no colon or equals character
  383. between the option and its parameter.
  384. If the parameter contains whitespace (or starts with : or =), the parameter
  385. must be enclosed within quotes. Within double quotes, the following escape
  386. sequences are available: \\\\, \\", \\t, \\n, \\r and \\v. A backslash
  387. preceding any other letter is ignored.
  388. If the first column of a config line is a \(aq#' character, the rest of the line
  389. will be treated as a comment.
  390. Only write one option per physical line in the config file.
  391. Specify the filename to \fI\-K, \-\-config\fP as \(aq-' to make curl read the file from stdin.
  392. Note that to be able to specify a URL in the config file, you need to specify
  393. it using the \fI\-\-url\fP option, and not by simply writing the URL on its own
  394. line. So, it could look similar to this:
  395. url = "https://curl.se/docs/"
  396. When curl is invoked, it (unless \fI\-q, \-\-disable\fP is used) checks for a default
  397. config file and uses it if found, even when this option is used. The default
  398. config file is checked for in the following places in this order:
  399. 1) Use the CURL_HOME environment variable if set
  400. 2) Use the XDG_CONFIG_HOME environment variable if set (Added in 7.73.0)
  401. 3) Use the HOME environment variable if set
  402. 4) Non-windows: use getpwuid to find the home directory
  403. 5) Windows: use APPDATA if set
  404. 6) Windows: use "USERPROFILE\\Application Data" if set
  405. 7) On windows, if there is no .curlrc file in the home dir, it checks for one
  406. in the same dir the curl executable is placed. On Unix-like systems, it will
  407. simply try to load .curlrc from the determined home dir.
  408. .nf
  409. # \-\-\- Example file \-\-\-
  410. # this is a comment
  411. url = "example.com"
  412. output = "curlhere.html"
  413. user-agent = "superagent/1.0"
  414. # and fetch another URL too
  415. url = "example.com/docs/manpage.html"
  416. \-O
  417. referer = "http://nowhereatall.example.com/"
  418. # \-\-\- End of example file \-\-\-
  419. .fi
  420. This option can be used multiple times to load multiple config files.
  421. Example:
  422. .nf
  423. curl --config file.txt https://example.com
  424. .fi
  425. .IP "\-\-connect-timeout <fractional seconds>"
  426. Maximum time in seconds that you allow curl\(aqs connection to take. This only
  427. limits the connection phase, so if curl connects within the given period it
  428. will continue \- if not it will exit. Since version 7.32.0, this option
  429. accepts decimal values.
  430. If this option is used several times, the last one will be used.
  431. Examples:
  432. .nf
  433. curl --connect-timeout 20 https://example.com
  434. curl --connect-timeout 3.14 https://example.com
  435. .fi
  436. See also \fI-m, --max-time\fP.
  437. .IP "\-\-connect-to <HOST1:PORT1:HOST2:PORT2>"
  438. For a request to the given HOST1:PORT1 pair, connect to HOST2:PORT2 instead.
  439. This option is suitable to direct requests at a specific server, e.g. at a
  440. specific cluster node in a cluster of servers. This option is only used to
  441. establish the network connection. It does NOT affect the hostname/port that is
  442. used for TLS/SSL (e.g. SNI, certificate verification) or for the application
  443. protocols. "HOST1" and "PORT1" may be the empty string, meaning "any
  444. host/port". "HOST2" and "PORT2" may also be the empty string, meaning "use the
  445. request\(aqs original host/port".
  446. A "host" specified to this option is compared as a string, so it needs to
  447. match the name used in request URL. It can be either numerical such as
  448. "127.0.0.1" or the full host name such as "example.org".
  449. This option can be used many times to add many connect rules.
  450. Example:
  451. .nf
  452. curl --connect-to example.com:443:example.net:8443 https://example.com
  453. .fi
  454. See also \fI--resolve\fP and \fI-H, --header\fP. Added in 7.49.0.
  455. .IP "\-C, \-\-continue-at <offset>"
  456. Continue/Resume a previous file transfer at the given offset. The given offset
  457. is the exact number of bytes that will be skipped, counting from the beginning
  458. of the source file before it is transferred to the destination. If used with
  459. uploads, the FTP server command SIZE will not be used by curl.
  460. Use "-C \-" to tell curl to automatically find out where/how to resume the
  461. transfer. It then uses the given output/input files to figure that out.
  462. If this option is used several times, the last one will be used.
  463. Examples:
  464. .nf
  465. curl -C - https://example.com
  466. curl -C 400 https://example.com
  467. .fi
  468. See also \fI-r, --range\fP.
  469. .IP "\-c, \-\-cookie-jar <filename>"
  470. (HTTP) Specify to which file you want curl to write all cookies after a completed
  471. operation. Curl writes all cookies from its in-memory cookie storage to the
  472. given file at the end of operations. If no cookies are known, no data will be
  473. written. The file will be written using the Netscape cookie file format. If
  474. you set the file name to a single dash, "-", the cookies will be written to
  475. stdout.
  476. This command line option will activate the cookie engine that makes curl
  477. record and use cookies. Another way to activate it is to use the \fI\-b, \-\-cookie\fP
  478. option.
  479. If the cookie jar cannot be created or written to, the whole curl operation
  480. will not fail or even report an error clearly. Using \fI\-v, \-\-verbose\fP will get a
  481. warning displayed, but that is the only visible feedback you get about this
  482. possibly lethal situation.
  483. If this option is used several times, the last specified file name will be
  484. used.
  485. Examples:
  486. .nf
  487. curl -c store-here.txt https://example.com
  488. curl -c store-here.txt -b read-these https://example.com
  489. .fi
  490. .IP "\-b, \-\-cookie <data|filename>"
  491. (HTTP) Pass the data to the HTTP server in the Cookie header. It is supposedly
  492. the data previously received from the server in a "Set-Cookie:" line. The
  493. data should be in the format "NAME1=VALUE1; NAME2=VALUE2".
  494. If no \(aq=' symbol is used in the argument, it is instead treated as a filename
  495. to read previously stored cookie from. This option also activates the cookie
  496. engine which will make curl record incoming cookies, which may be handy if
  497. you are using this in combination with the \fI\-L, \-\-location\fP option or do multiple URL
  498. transfers on the same invoke. If the file name is exactly a minus ("-"), curl
  499. will instead read the contents from stdin.
  500. The file format of the file to read cookies from should be plain HTTP headers
  501. (Set-Cookie style) or the Netscape/Mozilla cookie file format.
  502. The file specified with \fI\-b, \-\-cookie\fP is only used as input. No cookies will be
  503. written to the file. To store cookies, use the \fI\-c, \-\-cookie-jar\fP option.
  504. If you use the Set-Cookie file format and do not specify a domain then the
  505. cookie is not sent since the domain will never match. To address this, set a
  506. domain in Set-Cookie line (doing that will include sub-domains) or preferably:
  507. use the Netscape format.
  508. This option can be used multiple times.
  509. Users often want to both read cookies from a file and write updated cookies
  510. back to a file, so using both \fI\-b, \-\-cookie\fP and \fI\-c, \-\-cookie-jar\fP in the same command
  511. line is common.
  512. Examples:
  513. .nf
  514. curl -b cookiefile https://example.com
  515. curl -b cookiefile -c cookiefile https://example.com
  516. .fi
  517. .IP "\-\-create-dirs"
  518. When used in conjunction with the \fI\-o, \-\-output\fP option, curl will create the
  519. necessary local directory hierarchy as needed. This option creates the
  520. directories mentioned with the \fI\-o, \-\-output\fP option, nothing else. If the \-\-output
  521. file name uses no directory, or if the directories it mentions already exist,
  522. no directories will be created.
  523. Created dirs are made with mode 0750 on unix style file systems.
  524. To create remote directories when using FTP or SFTP, try \fI\-\-ftp-create-dirs\fP.
  525. Example:
  526. .nf
  527. curl --create-dirs --output local/dir/file https://example.com
  528. .fi
  529. .IP "\-\-create-file-mode <mode>"
  530. (SFTP SCP FILE) When curl is used to create files remotely using one of the supported
  531. protocols, this option allows the user to set which \(aqmode' to set on the file
  532. at creation time, instead of the default 0644.
  533. This option takes an octal number as argument.
  534. If this option is used several times, the last one will be used.
  535. Example:
  536. .nf
  537. curl --create-file-mode 0777 -T localfile sftp://example.com/new
  538. .fi
  539. See also \fI--ftp-create-dirs\fP. Added in 7.75.0.
  540. .IP "\-\-crlf"
  541. (FTP SMTP) Convert LF to CRLF in upload. Useful for MVS (OS/390).
  542. (SMTP added in 7.40.0)
  543. Example:
  544. .nf
  545. curl --crlf -T file ftp://example.com/
  546. .fi
  547. .IP "\-\-crlfile <file>"
  548. (TLS) Provide a file using PEM format with a Certificate Revocation List that may
  549. specify peer certificates that are to be considered revoked.
  550. If this option is used several times, the last one will be used.
  551. Example:
  552. .nf
  553. curl --crlfile rejects.txt https://example.com
  554. .fi
  555. .IP "\-\-curves <algorithm list>"
  556. (TLS) Tells curl to request specific curves to use during SSL session establishment
  557. according to RFC 8422, 5.1. Multiple algorithms can be provided by separating
  558. them with ":" (e.g. "X25519:P-521"). The parameter is available identically
  559. in the "openssl s_client/s_server" utilities.
  560. \fI\-\-curves\fP allows a OpenSSL powered curl to make SSL-connections with exactly
  561. the (EC) curve requested by the client, avoiding intransparent client/server
  562. negotiations.
  563. If this option is set, the default curves list built into openssl will be
  564. ignored.
  565. Example:
  566. .nf
  567. curl --curves X25519 https://example.com
  568. .fi
  569. Added in 7.73.0.
  570. .IP "\-\-data-ascii <data>"
  571. (HTTP) This is just an alias for \fI\-d, \-\-data\fP.
  572. Example:
  573. .nf
  574. curl --data-ascii @file https://example.com
  575. .fi
  576. .IP "\-\-data-binary <data>"
  577. (HTTP) This posts data exactly as specified with no extra processing whatsoever.
  578. If you start the data with the letter @, the rest should be a filename. Data
  579. is posted in a similar manner as \fI\-d, \-\-data\fP does, except that newlines and
  580. carriage returns are preserved and conversions are never done.
  581. Like \fI\-d, \-\-data\fP the default content-type sent to the server is
  582. application/x-www-form-urlencoded. If you want the data to be treated as
  583. arbitrary binary data by the server then set the content-type to octet-stream:
  584. \-H "Content-Type: application/octet-stream".
  585. If this option is used several times, the ones following the first will append
  586. data as described in \fI\-d, \-\-data\fP.
  587. Example:
  588. .nf
  589. curl --data-binary @filename https://example.com
  590. .fi
  591. .IP "\-\-data-raw <data>"
  592. (HTTP) This posts data similarly to \fI\-d, \-\-data\fP but without the special
  593. interpretation of the @ character.
  594. Examples:
  595. .nf
  596. curl --data-raw "hello" https://example.com
  597. curl --data-raw "@at@at@" https://example.com
  598. .fi
  599. See also \fI-d, --data\fP. Added in 7.43.0.
  600. .IP "\-\-data-urlencode <data>"
  601. (HTTP) This posts data, similar to the other \fI\-d, \-\-data\fP options with the exception
  602. that this performs URL-encoding.
  603. To be CGI-compliant, the <data> part should begin with a \fIname\fP followed
  604. by a separator and a content specification. The <data> part can be passed to
  605. curl using one of the following syntaxes:
  606. .RS
  607. .IP "content"
  608. This will make curl URL-encode the content and pass that on. Just be careful
  609. so that the content does not contain any = or @ symbols, as that will then make
  610. the syntax match one of the other cases below!
  611. .IP "=content"
  612. This will make curl URL-encode the content and pass that on. The preceding =
  613. symbol is not included in the data.
  614. .IP "name=content"
  615. This will make curl URL-encode the content part and pass that on. Note that
  616. the name part is expected to be URL-encoded already.
  617. .IP "@filename"
  618. This will make curl load data from the given file (including any newlines),
  619. URL-encode that data and pass it on in the POST.
  620. .IP "name@filename"
  621. This will make curl load data from the given file (including any newlines),
  622. URL-encode that data and pass it on in the POST. The name part gets an equal
  623. sign appended, resulting in \fIname=urlencoded-file-content\fP. Note that the
  624. name is expected to be URL-encoded already.
  625. .RE
  626. Examples:
  627. .nf
  628. curl --data-urlencode name=val https://example.com
  629. curl --data-urlencode =encodethis https://example.com
  630. curl --data-urlencode name@file https://example.com
  631. curl --data-urlencode @fileonly https://example.com
  632. .fi
  633. See also \fI-d, --data\fP and \fI--data-raw\fP.
  634. .IP "\-d, \-\-data <data>"
  635. (HTTP MQTT) Sends the specified data in a POST request to the HTTP server, in the same way
  636. that a browser does when a user has filled in an HTML form and presses the
  637. submit button. This will cause curl to pass the data to the server using the
  638. content-type application/x-www-form-urlencoded. Compare to \fI\-F, \-\-form\fP.
  639. \fI\-\-data-raw\fP is almost the same but does not have a special interpretation of
  640. the @ character. To post data purely binary, you should instead use the
  641. \fI\-\-data-binary\fP option. To URL-encode the value of a form field you may use
  642. \fI\-\-data-urlencode\fP.
  643. If any of these options is used more than once on the same command line, the
  644. data pieces specified will be merged together with a separating
  645. &-symbol. Thus, using \(aq-d name=daniel \-d skill=lousy' would generate a post
  646. chunk that looks like \&\(aqname=daniel&skill=lousy'.
  647. If you start the data with the letter @, the rest should be a file name to
  648. read the data from, or \- if you want curl to read the data from stdin. Posting
  649. data from a file named \&\(aqfoobar' would thus be done with \fI\-d, \-\-data\fP @foobar. When
  650. \fI\-d, \-\-data\fP is told to read from a file like that, carriage returns and newlines
  651. will be stripped out. If you do not want the @ character to have a special
  652. interpretation use \fI\-\-data-raw\fP instead.
  653. Examples:
  654. .nf
  655. curl -d "name=curl" https://example.com
  656. curl -d "name=curl" -d "tool=cmdline" https://example.com
  657. curl -d @filename https://example.com
  658. .fi
  659. See also \fI--data-binary\fP, \fI--data-urlencode\fP and \fI--data-raw\fP. This option overrides \fI-F, --form\fP and \fI-I, --head\fP and \fI-T, --upload-file\fP.
  660. .IP "\-\-delegation <LEVEL>"
  661. (GSS/kerberos) Set LEVEL to tell the server what it is allowed to delegate when it
  662. comes to user credentials.
  663. .RS
  664. .IP "none"
  665. Do not allow any delegation.
  666. .IP "policy"
  667. Delegates if and only if the OK-AS-DELEGATE flag is set in the Kerberos
  668. service ticket, which is a matter of realm policy.
  669. .IP "always"
  670. Unconditionally allow the server to delegate.
  671. .RE
  672. If this option is used several times, the last one will be used.
  673. Example:
  674. .nf
  675. curl --delegation "none" https://example.com
  676. .fi
  677. .IP "\-\-digest"
  678. (HTTP) Enables HTTP Digest authentication. This is an authentication scheme that
  679. prevents the password from being sent over the wire in clear text. Use this in
  680. combination with the normal \fI\-u, \-\-user\fP option to set user name and password.
  681. If this option is used several times, only the first one is used.
  682. Example:
  683. .nf
  684. curl -u name:password --digest https://example.com
  685. .fi
  686. See also \fI-u, --user\fP, \fI--proxy-digest\fP and \fI--anyauth\fP. This option overrides \fI--basic\fP and \fI--ntlm\fP and \fI--negotiate\fP.
  687. .IP "\-\-disable-eprt"
  688. (FTP) Tell curl to disable the use of the EPRT and LPRT commands when doing active
  689. FTP transfers. Curl will normally always first attempt to use EPRT, then LPRT
  690. before using PORT, but with this option, it will use PORT right away. EPRT and
  691. LPRT are extensions to the original FTP protocol, and may not work on all
  692. servers, but they enable more functionality in a better way than the
  693. traditional PORT command.
  694. \-\-eprt can be used to explicitly enable EPRT again and \-\-no-eprt is an alias
  695. for \fI\-\-disable-eprt\fP.
  696. If the server is accessed using IPv6, this option will have no effect as EPRT
  697. is necessary then.
  698. Disabling EPRT only changes the active behavior. If you want to switch to
  699. passive mode you need to not use \fI\-P, \-\-ftp-port\fP or force it with \fI\-\-ftp-pasv\fP.
  700. Example:
  701. .nf
  702. curl --disable-eprt ftp://example.com/
  703. .fi
  704. .IP "\-\-disable-epsv"
  705. (FTP) Tell curl to disable the use of the EPSV command when doing passive FTP
  706. transfers. Curl will normally always first attempt to use EPSV before
  707. PASV, but with this option, it will not try using EPSV.
  708. \-\-epsv can be used to explicitly enable EPSV again and \-\-no-epsv is an alias
  709. for \fI\-\-disable-epsv\fP.
  710. If the server is an IPv6 host, this option will have no effect as EPSV is
  711. necessary then.
  712. Disabling EPSV only changes the passive behavior. If you want to switch to
  713. active mode you need to use \fI\-P, \-\-ftp-port\fP.
  714. Example:
  715. .nf
  716. curl --disable-epsv ftp://example.com/
  717. .fi
  718. .IP "\-q, \-\-disable"
  719. If used as the first parameter on the command line, the \fIcurlrc\fP config
  720. file will not be read and used. See the \fI\-K, \-\-config\fP for details on the default
  721. config file search path.
  722. Example:
  723. .nf
  724. curl -q https://example.com
  725. .fi
  726. .IP "\-\-disallow-username-in-url"
  727. (HTTP) This tells curl to exit if passed a url containing a username. This is probably
  728. most useful when the URL is being provided at run-time or similar.
  729. Example:
  730. .nf
  731. curl --disallow-username-in-url https://example.com
  732. .fi
  733. See also \fI--proto\fP. Added in 7.61.0.
  734. .IP "\-\-dns-interface <interface>"
  735. (DNS) Tell curl to send outgoing DNS requests through <interface>. This option is a
  736. counterpart to \fI\-\-interface\fP (which does not affect DNS). The supplied string
  737. must be an interface name (not an address).
  738. Example:
  739. .nf
  740. curl --dns-interface eth0 https://example.com
  741. .fi
  742. See also \fI--dns-ipv4-addr\fP and \fI--dns-ipv6-addr\fP. \fI--dns-interface\fP requires that the underlying libcurl was built to support c-ares. Added in 7.33.0.
  743. .IP "\-\-dns-ipv4-addr <address>"
  744. (DNS) Tell curl to bind to <ip-address> when making IPv4 DNS requests, so that
  745. the DNS requests originate from this address. The argument should be a
  746. single IPv4 address.
  747. If this option is used several times, the last one will be used.
  748. Example:
  749. .nf
  750. curl --dns-ipv4-addr 10.1.2.3 https://example.com
  751. .fi
  752. See also \fI--dns-interface\fP and \fI--dns-ipv6-addr\fP. \fI--dns-ipv4-addr\fP requires that the underlying libcurl was built to support c-ares. Added in 7.33.0.
  753. .IP "\-\-dns-ipv6-addr <address>"
  754. (DNS) Tell curl to bind to <ip-address> when making IPv6 DNS requests, so that
  755. the DNS requests originate from this address. The argument should be a
  756. single IPv6 address.
  757. If this option is used several times, the last one will be used.
  758. Example:
  759. .nf
  760. curl --dns-ipv6-addr 2a04:4e42::561 https://example.com
  761. .fi
  762. See also \fI--dns-interface\fP and \fI--dns-ipv4-addr\fP. \fI--dns-ipv6-addr\fP requires that the underlying libcurl was built to support c-ares. Added in 7.33.0.
  763. .IP "\-\-dns-servers <addresses>"
  764. Set the list of DNS servers to be used instead of the system default.
  765. The list of IP addresses should be separated with commas. Port numbers
  766. may also optionally be given as \fI:<port-number>\fP after each IP
  767. address.
  768. If this option is used several times, the last one will be used.
  769. Example:
  770. .nf
  771. curl --dns-servers 192.168.0.1,192.168.0.2 https://example.com
  772. .fi
  773. \fI--dns-servers\fP requires that the underlying libcurl was built to support c-ares. Added in 7.33.0.
  774. .IP "\-\-doh-cert-status"
  775. (all) Same as \fI\-\-cert-status\fP but used for DoH (DNS-over-HTTPS).
  776. Example:
  777. .nf
  778. curl --doh-cert-status --doh-url https://doh.example https://example.com
  779. .fi
  780. Added in 7.76.0.
  781. .IP "\-\-doh-insecure"
  782. (all) Same as \fI\-k, \-\-insecure\fP but used for DoH (DNS-over-HTTPS).
  783. Example:
  784. .nf
  785. curl --doh-insecure --doh-url https://doh.example https://example.com
  786. .fi
  787. Added in 7.76.0.
  788. .IP "\-\-doh-url <URL>"
  789. (all) Specifies which DNS-over-HTTPS (DoH) server to use to resolve hostnames,
  790. instead of using the default name resolver mechanism. The URL must be HTTPS.
  791. Some SSL options that you set for your transfer will apply to DoH since the
  792. name lookups take place over SSL. However, the certificate verification
  793. settings are not inherited and can be controlled separately via
  794. \fI\-\-doh-insecure\fP and \fI\-\-doh-cert-status\fP.
  795. If this option is used several times, the last one will be used.
  796. Example:
  797. .nf
  798. curl --doh-url https://doh.example https://example.com
  799. .fi
  800. Added in 7.62.0.
  801. .IP "\-D, \-\-dump-header <filename>"
  802. (HTTP FTP) Write the received protocol headers to the specified file. If no headers are
  803. received, the use of this option will create an empty file.
  804. When used in FTP, the FTP server response lines are considered being "headers"
  805. and thus are saved there.
  806. If this option is used several times, the last one will be used.
  807. Example:
  808. .nf
  809. curl --dump-header store.txt https://example.com
  810. .fi
  811. See also \fI-o, --output\fP.
  812. .IP "\-\-egd-file <file>"
  813. (TLS) Specify the path name to the Entropy Gathering Daemon socket. The socket is
  814. used to seed the random engine for SSL connections.
  815. Example:
  816. .nf
  817. curl --egd-file /random/here https://example.com
  818. .fi
  819. See also \fI--random-file\fP.
  820. .IP "\-\-engine <name>"
  821. (TLS) Select the OpenSSL crypto engine to use for cipher operations. Use \fI\-\-engine\fP
  822. list to print a list of build-time supported engines. Note that not all (and
  823. possibly none) of the engines may be available at run-time.
  824. Example:
  825. .nf
  826. curl --engine flavor https://example.com
  827. .fi
  828. .IP "\-\-etag-compare <file>"
  829. (HTTP) This option makes a conditional HTTP request for the specific ETag read
  830. from the given file by sending a custom If-None-Match header using the
  831. stored ETag.
  832. For correct results, make sure that the specified file contains only a
  833. single line with the desired ETag. An empty file is parsed as an empty
  834. ETag.
  835. Use the option \fI\-\-etag-save\fP to first save the ETag from a response, and
  836. then use this option to compare against the saved ETag in a subsequent
  837. request.
  838. Example:
  839. .nf
  840. curl --etag-compare etag.txt https://example.com
  841. .fi
  842. Added in 7.68.0.
  843. .IP "\-\-etag-save <file>"
  844. (HTTP) This option saves an HTTP ETag to the specified file. An ETag is a
  845. caching related header, usually returned in a response.
  846. If no ETag is sent by the server, an empty file is created.
  847. Example:
  848. .nf
  849. curl --etag-save storetag.txt https://example.com
  850. .fi
  851. Added in 7.68.0.
  852. .IP "\-\-expect100-timeout <seconds>"
  853. (HTTP) Maximum time in seconds that you allow curl to wait for a 100-continue
  854. response when curl emits an Expects: 100-continue header in its request. By
  855. default curl will wait one second. This option accepts decimal values! When
  856. curl stops waiting, it will continue as if the response has been received.
  857. Example:
  858. .nf
  859. curl --expect100-timeout 2.5 -T file https://example.com
  860. .fi
  861. See also \fI--connect-timeout\fP. Added in 7.47.0.
  862. .IP "\-\-fail-early"
  863. Fail and exit on the first detected transfer error.
  864. When curl is used to do multiple transfers on the command line, it will
  865. attempt to operate on each given URL, one by one. By default, it will ignore
  866. errors if there are more URLs given and the last URL\(aqs success will determine
  867. the error code curl returns. So early failures will be "hidden" by subsequent
  868. successful transfers.
  869. Using this option, curl will instead return an error on the first transfer
  870. that fails, independent of the amount of URLs that are given on the command
  871. line. This way, no transfer failures go undetected by scripts and similar.
  872. This option is global and does not need to be specified for each use of \fI\-:, \-\-next\fP.
  873. This option does not imply \fI\-f, \-\-fail\fP, which causes transfers to fail due to the
  874. server\(aqs HTTP status code. You can combine the two options, however note \fI\-f, \-\-fail\fP
  875. is not global and is therefore contained by \fI\-:, \-\-next\fP.
  876. Example:
  877. .nf
  878. curl --fail-early https://example.com https://two.example
  879. .fi
  880. Added in 7.52.0.
  881. .IP "\-\-fail-with-body"
  882. (HTTP) Return an error on server errors where the HTTP response code is 400 or
  883. greater). In normal cases when an HTTP server fails to deliver a document, it
  884. returns an HTML document stating so (which often also describes why and
  885. more). This flag will still allow curl to output and save that content but
  886. also to return error 22.
  887. This is an alternative option to \fI\-f, \-\-fail\fP which makes curl fail for the same
  888. circumstances but without saving the content.
  889. Example:
  890. .nf
  891. curl --fail-with-body https://example.com
  892. .fi
  893. See also \fI-f, --fail\fP. Added in 7.76.0.
  894. .IP "\-f, \-\-fail"
  895. (HTTP) Fail silently (no output at all) on server errors. This is mostly done to
  896. enable scripts etc to better deal with failed attempts. In normal cases
  897. when an HTTP server fails to deliver a document, it returns an HTML document
  898. stating so (which often also describes why and more). This flag will prevent
  899. curl from outputting that and return error 22.
  900. This method is not fail-safe and there are occasions where non-successful
  901. response codes will slip through, especially when authentication is involved
  902. (response codes 401 and 407).
  903. Example:
  904. .nf
  905. curl --fail https://example.com
  906. .fi
  907. See also \fI--fail-with-body\fP.
  908. .IP "\-\-false-start"
  909. (TLS) Tells curl to use false start during the TLS handshake. False start is a mode
  910. where a TLS client will start sending application data before verifying the
  911. server\(aqs Finished message, thus saving a round trip when performing a full
  912. handshake.
  913. This is currently only implemented in the NSS and Secure Transport (on iOS 7.0
  914. or later, or OS X 10.9 or later) backends.
  915. Example:
  916. .nf
  917. curl --false-start https://example.com
  918. .fi
  919. Added in 7.42.0.
  920. .IP "\-\-form-string <name=string>"
  921. (HTTP SMTP IMAP) Similar to \fI\-F, \-\-form\fP except that the value string for the named parameter is used
  922. literally. Leading \&\(aq@' and \&'<' characters, and the \&';type=' string in
  923. the value have no special meaning. Use this in preference to \fI\-F, \-\-form\fP if
  924. there\(aqs any possibility that the string value may accidentally trigger the
  925. \&\(aq@' or \&'<' features of \fI\-F, \-\-form\fP.
  926. Example:
  927. .nf
  928. curl --form-string "data" https://example.com
  929. .fi
  930. See also \fI-F, --form\fP.
  931. .IP "\-F, \-\-form <name=content>"
  932. (HTTP SMTP IMAP) For HTTP protocol family, this lets curl emulate a filled-in form in which a
  933. user has pressed the submit button. This causes curl to POST data using the
  934. Content-Type multipart/form-data according to RFC 2388.
  935. For SMTP and IMAP protocols, this is the means to compose a multipart mail
  936. message to transmit.
  937. This enables uploading of binary files etc. To force the \(aqcontent' part to be
  938. a file, prefix the file name with an @ sign. To just get the content part from
  939. a file, prefix the file name with the symbol <. The difference between @ and <
  940. is then that @ makes a file get attached in the post as a file upload, while
  941. the < makes a text field and just get the contents for that text field from a
  942. file.
  943. Tell curl to read content from stdin instead of a file by using \- as
  944. filename. This goes for both @ and < constructs. When stdin is used, the
  945. contents is buffered in memory first by curl to determine its size and allow a
  946. possible resend. Defining a part\(aqs data from a named non-regular file (such
  947. as a named pipe or similar) is unfortunately not subject to buffering and will
  948. be effectively read at transmission time; since the full size is unknown
  949. before the transfer starts, such data is sent as chunks by HTTP and rejected
  950. by IMAP.
  951. Example: send an image to an HTTP server, where \&\(aqprofile' is the name of the
  952. form-field to which the file portrait.jpg will be the input:
  953. curl \-F [email protected] https://example.com/upload.cgi
  954. Example: send your name and shoe size in two text fields to the server:
  955. curl \-F name=John \-F shoesize=11 https://example.com/
  956. Example: send your essay in a text field to the server. Send it as a plain
  957. text field, but get the contents for it from a local file:
  958. curl \-F "story=<hugefile.txt" https://example.com/
  959. You can also tell curl what Content-Type to use by using \(aqtype=', in a manner
  960. similar to:
  961. curl \-F "[email protected];type=text/html" example.com
  962. or
  963. curl \-F "name=daniel;type=text/foo" example.com
  964. You can also explicitly change the name field of a file upload part by setting
  965. filename=, like this:
  966. curl \-F "file=@localfile;filename=nameinpost" example.com
  967. If filename/path contains \(aq,' or ';', it must be quoted by double-quotes like:
  968. curl \-F "file=@\\"local,file\\";filename=\\"name;in;post\\"" example.com
  969. or
  970. curl \-F \(aqfile=@"local,file";filename="name;in;post"' example.com
  971. Note that if a filename/path is quoted by double-quotes, any double-quote
  972. or backslash within the filename must be escaped by backslash.
  973. Quoting must also be applied to non-file data if it contains semicolons,
  974. leading/trailing spaces or leading double quotes:
  975. curl \-F \(aqcolors="red; green; blue";type=text/x-myapp' example.com
  976. You can add custom headers to the field by setting headers=, like
  977. curl \-F "submit=OK;headers=\\"X-submit-type: OK\\"" example.com
  978. or
  979. curl \-F "submit=OK;headers=@headerfile" example.com
  980. The headers= keyword may appear more that once and above notes about quoting
  981. apply. When headers are read from a file, Empty lines and lines starting
  982. with \(aq#' are comments and ignored; each header can be folded by splitting
  983. between two words and starting the continuation line with a space; embedded
  984. carriage-returns and trailing spaces are stripped.
  985. Here is an example of a header file contents:
  986. # This file contain two headers.
  987. .br
  988. X-header-1: this is a header
  989. # The following header is folded.
  990. .br
  991. X-header-2: this is
  992. .br
  993. another header
  994. To support sending multipart mail messages, the syntax is extended as follows:
  995. .br
  996. \- name can be omitted: the equal sign is the first character of the argument,
  997. .br
  998. \- if data starts with \(aq(', this signals to start a new multipart: it can be
  999. followed by a content type specification.
  1000. .br
  1001. \- a multipart can be terminated with a \(aq=)' argument.
  1002. Example: the following command sends an SMTP mime e-mail consisting in an
  1003. inline part in two alternative formats: plain text and HTML. It attaches a
  1004. text file:
  1005. curl \-F \(aq=(;type=multipart/alternative' \\
  1006. .br
  1007. \-F \(aq=plain text message' \\
  1008. .br
  1009. \-F \(aq= <body>HTML message</body>;type=text/html' \\
  1010. .br
  1011. \-F \(aq=)' \-F '[email protected]' ... smtp://example.com
  1012. Data can be encoded for transfer using encoder=. Available encodings are
  1013. \fIbinary\fP and \fI8bit\fP that do nothing else than adding the corresponding
  1014. Content-Transfer-Encoding header, \fI7bit\fP that only rejects 8-bit characters
  1015. with a transfer error, \fIquoted-printable\fP and \fIbase64\fP that encodes data
  1016. according to the corresponding schemes, limiting lines length to 76
  1017. characters.
  1018. Example: send multipart mail with a quoted-printable text message and a
  1019. base64 attached file:
  1020. curl \-F \(aq=text message;encoder=quoted-printable' \\
  1021. .br
  1022. \-F \(aq=@localfile;encoder=base64' ... smtp://example.com
  1023. See further examples and details in the MANUAL.
  1024. This option can be used multiple times.
  1025. Example:
  1026. .nf
  1027. curl --form "name=curl" --form "file=@loadthis" https://example.com
  1028. .fi
  1029. This option overrides \fI-d, --data\fP and \fI-I, --head\fP and \fI-T, --upload-file\fP.
  1030. .IP "\-\-ftp-account <data>"
  1031. (FTP) When an FTP server asks for "account data" after user name and password has
  1032. been provided, this data is sent off using the ACCT command.
  1033. If this option is used several times, the last one will be used.
  1034. Example:
  1035. .nf
  1036. curl --ftp-account "mr.robot" ftp://example.com/
  1037. .fi
  1038. .IP "\-\-ftp-alternative-to-user <command>"
  1039. (FTP) If authenticating with the USER and PASS commands fails, send this command.
  1040. When connecting to Tumbleweed\(aqs Secure Transport server over FTPS using a
  1041. client certificate, using "SITE AUTH" will tell the server to retrieve the
  1042. username from the certificate.
  1043. Example:
  1044. .nf
  1045. curl --ftp-alternative-to-user "U53r" ftp://example.com
  1046. .fi
  1047. .IP "\-\-ftp-create-dirs"
  1048. (FTP SFTP) When an FTP or SFTP URL/operation uses a path that does not currently exist on
  1049. the server, the standard behavior of curl is to fail. Using this option, curl
  1050. will instead attempt to create missing directories.
  1051. Example:
  1052. .nf
  1053. curl --ftp-create-dirs -T file ftp://example.com/remote/path/file
  1054. .fi
  1055. See also \fI--create-dirs\fP.
  1056. .IP "\-\-ftp-method <method>"
  1057. (FTP) Control what method curl should use to reach a file on an FTP(S)
  1058. server. The method argument should be one of the following alternatives:
  1059. .RS
  1060. .IP multicwd
  1061. curl does a single CWD operation for each path part in the given URL. For deep
  1062. hierarchies this means many commands. This is how RFC 1738 says it should
  1063. be done. This is the default but the slowest behavior.
  1064. .IP nocwd
  1065. curl does no CWD at all. curl will do SIZE, RETR, STOR etc and give a full
  1066. path to the server for all these commands. This is the fastest behavior.
  1067. .IP singlecwd
  1068. curl does one CWD with the full target directory and then operates on the file
  1069. \&"normally" (like in the multicwd case). This is somewhat more standards
  1070. compliant than \(aqnocwd' but without the full penalty of 'multicwd'.
  1071. .RE
  1072. Examples:
  1073. .nf
  1074. curl --ftp-method multicwd ftp://example.com/dir1/dir2/file
  1075. curl --ftp-method nocwd ftp://example.com/dir1/dir2/file
  1076. curl --ftp-method singlecwd ftp://example.com/dir1/dir2/file
  1077. .fi
  1078. .IP "\-\-ftp-pasv"
  1079. (FTP) Use passive mode for the data connection. Passive is the internal default
  1080. behavior, but using this option can be used to override a previous \fI\-P, \-\-ftp-port\fP
  1081. option.
  1082. If this option is used several times, only the first one is used. Undoing an
  1083. enforced passive really is not doable but you must then instead enforce the
  1084. correct \fI\-P, \-\-ftp-port\fP again.
  1085. Passive mode means that curl will try the EPSV command first and then PASV,
  1086. unless \fI\-\-disable-epsv\fP is used.
  1087. Example:
  1088. .nf
  1089. curl --ftp-pasv ftp://example.com/
  1090. .fi
  1091. See also \fI--disable-epsv\fP.
  1092. .IP "\-P, \-\-ftp-port <address>"
  1093. (FTP) Reverses the default initiator/listener roles when connecting with FTP. This
  1094. option makes curl use active mode. curl then tells the server to connect back
  1095. to the client\(aqs specified address and port, while passive mode asks the server
  1096. to setup an IP address and port for it to connect to. <address> should be one
  1097. of:
  1098. .RS
  1099. .IP interface
  1100. e.g. "eth0" to specify which interface\(aqs IP address you want to use (Unix only)
  1101. .IP "IP address"
  1102. e.g. "192.168.10.1" to specify the exact IP address
  1103. .IP "host name"
  1104. e.g. "my.host.domain" to specify the machine
  1105. .IP "-"
  1106. make curl pick the same IP address that is already used for the control
  1107. connection
  1108. .RE
  1109. If this option is used several times, the last one will be used. Disable the
  1110. use of PORT with \fI\-\-ftp-pasv\fP. Disable the attempt to use the EPRT command
  1111. instead of PORT by using \fI\-\-disable-eprt\fP. EPRT is really PORT++.
  1112. You can also append \&":[start]-[end]\&" to the right of the address, to tell
  1113. curl what TCP port range to use. That means you specify a port range, from a
  1114. lower to a higher number. A single number works as well, but do note that it
  1115. increases the risk of failure since the port may not be available.
  1116. Examples:
  1117. .nf
  1118. curl -P - ftp:/example.com
  1119. curl -P eth0 ftp:/example.com
  1120. curl -P 192.168.0.2 ftp:/example.com
  1121. .fi
  1122. See also \fI--ftp-pasv\fP and \fI--disable-eprt\fP.
  1123. .IP "\-\-ftp-pret"
  1124. (FTP) Tell curl to send a PRET command before PASV (and EPSV). Certain FTP servers,
  1125. mainly drftpd, require this non-standard command for directory listings as
  1126. well as up and downloads in PASV mode.
  1127. Example:
  1128. .nf
  1129. curl --ftp-pret ftp://example.com/
  1130. .fi
  1131. .IP "\-\-ftp-skip-pasv-ip"
  1132. (FTP) Tell curl to not use the IP address the server suggests in its response
  1133. to curl\(aqs PASV command when curl connects the data connection. Instead curl
  1134. will re-use the same IP address it already uses for the control
  1135. connection.
  1136. Since curl 7.74.0 this option is enabled by default.
  1137. This option has no effect if PORT, EPRT or EPSV is used instead of PASV.
  1138. Example:
  1139. .nf
  1140. curl --ftp-skip-pasv-ip ftp://example.com/
  1141. .fi
  1142. See also \fI--ftp-pasv\fP.
  1143. .IP "\-\-ftp-ssl-ccc-mode <active/passive>"
  1144. (FTP) Sets the CCC mode. The passive mode will not initiate the shutdown, but
  1145. instead wait for the server to do it, and will not reply to the shutdown from
  1146. the server. The active mode initiates the shutdown and waits for a reply from
  1147. the server.
  1148. Example:
  1149. .nf
  1150. curl --ftp-ssl-ccc-mode active --ftp-ssl-ccc ftps://example.com/
  1151. .fi
  1152. See also \fI--ftp-ssl-ccc\fP.
  1153. .IP "\-\-ftp-ssl-ccc"
  1154. (FTP) Use CCC (Clear Command Channel) Shuts down the SSL/TLS layer after
  1155. authenticating. The rest of the control channel communication will be
  1156. unencrypted. This allows NAT routers to follow the FTP transaction. The
  1157. default mode is passive.
  1158. Example:
  1159. .nf
  1160. curl --ftp-ssl-ccc ftps://example.com/
  1161. .fi
  1162. See also \fI--ssl\fP and \fI--ftp-ssl-ccc-mode\fP.
  1163. .IP "\-\-ftp-ssl-control"
  1164. (FTP) Require SSL/TLS for the FTP login, clear for transfer. Allows secure
  1165. authentication, but non-encrypted data transfers for efficiency. Fails the
  1166. transfer if the server does not support SSL/TLS.
  1167. Example:
  1168. .nf
  1169. curl --ftp-ssl-control ftp://example.com
  1170. .fi
  1171. .IP "\-G, \-\-get"
  1172. When used, this option will make all data specified with \fI\-d, \-\-data\fP, \fI\-\-data-binary\fP
  1173. or \fI\-\-data-urlencode\fP to be used in an HTTP GET request instead of the POST
  1174. request that otherwise would be used. The data will be appended to the URL
  1175. with a \(aq?' separator.
  1176. If used in combination with \fI\-I, \-\-head\fP, the POST data will instead be appended to
  1177. the URL with a HEAD request.
  1178. If this option is used several times, only the first one is used. This is
  1179. because undoing a GET does not make sense, but you should then instead enforce
  1180. the alternative method you prefer.
  1181. Examples:
  1182. .nf
  1183. curl --get https://example.com
  1184. curl --get -d "tool=curl" -d "age=old" https://example.com
  1185. curl --get -I -d "tool=curl" https://example.com
  1186. .fi
  1187. .IP "\-g, \-\-globoff"
  1188. This option switches off the "URL globbing parser". When you set this option,
  1189. you can specify URLs that contain the letters {}[] without having curl itself
  1190. interpret them. Note that these letters are not normal legal URL contents but
  1191. they should be encoded according to the URI standard.
  1192. Example:
  1193. .nf
  1194. curl -g "https://example.com/{[]}}}}"
  1195. .fi
  1196. .IP "\-\-happy-eyeballs-timeout-ms <milliseconds>"
  1197. Happy Eyeballs is an algorithm that attempts to connect to both IPv4 and IPv6
  1198. addresses for dual-stack hosts, giving IPv6 a head-start of the specified
  1199. number of milliseconds. If the IPv6 address cannot be connected to within that
  1200. time, then a connection attempt is made to the IPv4 address in parallel. The
  1201. first connection to be established is the one that is used.
  1202. The range of suggested useful values is limited. Happy Eyeballs RFC 6555 says
  1203. "It is RECOMMENDED that connection attempts be paced 150-250 ms apart to
  1204. balance human factors against network load." libcurl currently defaults to
  1205. 200 ms. Firefox and Chrome currently default to 300 ms.
  1206. If this option is used several times, the last one will be used.
  1207. Example:
  1208. .nf
  1209. curl --happy-eyeballs-timeout-ms 500 https://example.com
  1210. .fi
  1211. Added in 7.59.0.
  1212. .IP "\-\-haproxy-protocol"
  1213. (HTTP) Send a HAProxy PROXY protocol v1 header at the beginning of the
  1214. connection. This is used by some load balancers and reverse proxies to
  1215. indicate the client\(aqs true IP address and port.
  1216. This option is primarily useful when sending test requests to a service that
  1217. expects this header.
  1218. Example:
  1219. .nf
  1220. curl --haproxy-protocol https://example.com
  1221. .fi
  1222. Added in 7.60.0.
  1223. .IP "\-I, \-\-head"
  1224. (HTTP FTP FILE) Fetch the headers only! HTTP-servers feature the command HEAD which this uses
  1225. to get nothing but the header of a document. When used on an FTP or FILE file,
  1226. curl displays the file size and last modification time only.
  1227. Example:
  1228. .nf
  1229. curl -I https://example.com
  1230. .fi
  1231. .IP "\-H, \-\-header <header/@file>"
  1232. (HTTP) Extra header to include in the request when sending HTTP to a server. You may
  1233. specify any number of extra headers. Note that if you should add a custom
  1234. header that has the same name as one of the internal ones curl would use, your
  1235. externally set header will be used instead of the internal one. This allows
  1236. you to make even trickier stuff than curl would normally do. You should not
  1237. replace internally set headers without knowing perfectly well what you are
  1238. doing. Remove an internal header by giving a replacement without content on
  1239. the right side of the colon, as in: \-H \&"Host:". If you send the custom
  1240. header with no-value then its header must be terminated with a semicolon, such
  1241. as \-H \&"X-Custom-Header;" to send "X-Custom-Header:".
  1242. curl will make sure that each header you add/replace is sent with the proper
  1243. end-of-line marker, you should thus \fBnot\fP add that as a part of the header
  1244. content: do not add newlines or carriage returns, they will only mess things
  1245. up for you.
  1246. This option can take an argument in @filename style, which then adds a header
  1247. for each line in the input file. Using @- will make curl read the header file
  1248. from stdin. Added in 7.55.0.
  1249. You need \fI\-\-proxy-header\fP to send custom headers intended for a HTTP
  1250. proxy. Added in 7.37.0.
  1251. Passing on a "Transfer-Encoding: chunked" header when doing a HTTP request
  1252. with a request body, will make curl send the data using chunked encoding.
  1253. \fBWARNING\fP: headers set with this option will be set in all requests \- even
  1254. after redirects are followed, like when told with \fI\-L, \-\-location\fP. This can lead to
  1255. the header being sent to other hosts than the original host, so sensitive
  1256. headers should be used with caution combined with following redirects.
  1257. This option can be used multiple times to add/replace/remove multiple headers.
  1258. Examples:
  1259. .nf
  1260. curl -H "X-First-Name: Joe" https://example.com
  1261. curl -H "User-Agent: yes-please/2000" https://example.com
  1262. curl -H "Host:" https://example.com
  1263. .fi
  1264. See also \fI-A, --user-agent\fP and \fI-e, --referer\fP.
  1265. .IP "\-h, \-\-help <category>"
  1266. Usage help. This lists all commands of the <category>.
  1267. If no arg was provided, curl will display the most important
  1268. command line arguments.
  1269. If the argument "all" was provided, curl will display all options available.
  1270. If the argument "category" was provided, curl will display all categories and
  1271. their meanings.
  1272. Example:
  1273. .nf
  1274. curl --help all
  1275. .fi
  1276. .IP "\-\-hostpubmd5 <md5>"
  1277. (SFTP SCP) Pass a string containing 32 hexadecimal digits. The string should
  1278. be the 128 bit MD5 checksum of the remote host\(aqs public key, curl will refuse
  1279. the connection with the host unless the md5sums match.
  1280. Example:
  1281. .nf
  1282. curl --hostpubmd5 e5c1c49020640a5ab0f2034854c321a8 sftp://example.com/
  1283. .fi
  1284. .IP "\-\-hostpubsha256 <sha256>"
  1285. (SFTP SCP) Pass a string containing a Base64-encoded SHA256 hash of the remote
  1286. host\(aqs public key. Curl will refuse the connection with the host
  1287. unless the hashes match.
  1288. Example:
  1289. .nf
  1290. curl --hostpubsha256 NDVkMTQxMGQ1ODdmMjQ3MjczYjAyOTY5MmRkMjVmNDQ= sftp://example.com/
  1291. .fi
  1292. Added in 7.80.0.
  1293. .IP "\-\-hsts <file name>"
  1294. (HTTPS) This option enables HSTS for the transfer. If the file name points to an
  1295. existing HSTS cache file, that will be used. After a completed transfer, the
  1296. cache will be saved to the file name again if it has been modified.
  1297. Specify a "" file name (zero length) to avoid loading/saving and make curl
  1298. just handle HSTS in memory.
  1299. If this option is used several times, curl will load contents from all the
  1300. files but the last one will be used for saving.
  1301. Example:
  1302. .nf
  1303. curl --hsts cache.txt https://example.com
  1304. .fi
  1305. Added in 7.74.0.
  1306. .IP "\-\-http0.9"
  1307. (HTTP) Tells curl to be fine with HTTP version 0.9 response.
  1308. HTTP/0.9 is a completely headerless response and therefore you can also
  1309. connect with this to non-HTTP servers and still get a response since curl will
  1310. simply transparently downgrade \- if allowed.
  1311. Since curl 7.66.0, HTTP/0.9 is disabled by default.
  1312. Example:
  1313. .nf
  1314. curl --http0.9 https://example.com
  1315. .fi
  1316. Added in 7.64.0.
  1317. .IP "\-0, \-\-http1.0"
  1318. (HTTP) Tells curl to use HTTP version 1.0 instead of using its internally preferred
  1319. HTTP version.
  1320. Example:
  1321. .nf
  1322. curl --http1.0 https://example.com
  1323. .fi
  1324. This option overrides \fI--http1.1\fP and \fI--http2\fP.
  1325. .IP "\-\-http1.1"
  1326. (HTTP) Tells curl to use HTTP version 1.1.
  1327. Example:
  1328. .nf
  1329. curl --http1.1 https://example.com
  1330. .fi
  1331. This option overrides \fI-0, --http1.0\fP and \fI--http2\fP. Added in 7.33.0.
  1332. .IP "\-\-http2-prior-knowledge"
  1333. (HTTP) Tells curl to issue its non-TLS HTTP requests using HTTP/2 without HTTP/1.1
  1334. Upgrade. It requires prior knowledge that the server supports HTTP/2 straight
  1335. away. HTTPS requests will still do HTTP/2 the standard way with negotiated
  1336. protocol version in the TLS handshake.
  1337. Example:
  1338. .nf
  1339. curl --http2-prior-knowledge https://example.com
  1340. .fi
  1341. \fI--http2-prior-knowledge\fP requires that the underlying libcurl was built to support HTTP/2. This option overrides \fI--http1.1\fP and \fI-0, --http1.0\fP and \fI--http2\fP. Added in 7.49.0.
  1342. .IP "\-\-http2"
  1343. (HTTP) Tells curl to use HTTP version 2.
  1344. For HTTPS, this means curl will attempt to negotiate HTTP/2 in the TLS
  1345. handshake. curl does this by default.
  1346. For HTTP, this means curl will attempt to upgrade the request to HTTP/2 using
  1347. the Upgrade: request header.
  1348. Example:
  1349. .nf
  1350. curl --http2 https://example.com
  1351. .fi
  1352. See also \fI--http1.1\fP and \fI--http3\fP. \fI--http2\fP requires that the underlying libcurl was built to support HTTP/2. This option overrides \fI--http1.1\fP and \fI-0, --http1.0\fP and \fI--http2-prior-knowledge\fP. Added in 7.33.0.
  1353. .IP "\-\-http3"
  1354. (HTTP) \fBWARNING\fP: this option is experimental. Do not use in production.
  1355. Tells curl to use HTTP version 3 directly to the host and port number used in
  1356. the URL. A normal HTTP/3 transaction will be done to a host and then get
  1357. redirected via Alt-Svc, but this option allows a user to circumvent that when
  1358. you know that the target speaks HTTP/3 on the given host and port.
  1359. This option will make curl fail if a QUIC connection cannot be established, it
  1360. cannot fall back to a lower HTTP version on its own.
  1361. Example:
  1362. .nf
  1363. curl --http3 https://example.com
  1364. .fi
  1365. See also \fI--http1.1\fP and \fI--http2\fP. \fI--http3\fP requires that the underlying libcurl was built to support HTTP/3. This option overrides \fI--http1.1\fP and \fI-0, --http1.0\fP and \fI--http2\fP and \fI--http2-prior-knowledge\fP. Added in 7.66.0.
  1366. .IP "\-\-ignore-content-length"
  1367. (FTP HTTP) For HTTP, Ignore the Content-Length header. This is particularly useful for
  1368. servers running Apache 1.x, which will report incorrect Content-Length for
  1369. files larger than 2 gigabytes.
  1370. For FTP (since 7.46.0), skip the RETR command to figure out the size before
  1371. downloading a file.
  1372. This option does not work for HTTP if libcurl was built to use hyper.
  1373. Example:
  1374. .nf
  1375. curl --ignore-content-length https://example.com
  1376. .fi
  1377. .IP "\-i, \-\-include"
  1378. Include the HTTP response headers in the output. The HTTP response headers can
  1379. include things like server name, cookies, date of the document, HTTP version
  1380. and more...
  1381. To view the request headers, consider the \fI\-v, \-\-verbose\fP option.
  1382. Example:
  1383. .nf
  1384. curl -i https://example.com
  1385. .fi
  1386. See also \fI-v, --verbose\fP.
  1387. .IP "\-k, \-\-insecure"
  1388. (TLS) By default, every SSL connection curl makes is verified to be secure. This
  1389. option allows curl to proceed and operate even for server connections
  1390. otherwise considered insecure.
  1391. The server connection is verified by making sure the server\(aqs certificate
  1392. contains the right name and verifies successfully using the cert store.
  1393. See this online resource for further details:
  1394. https://curl.se/docs/sslcerts.html
  1395. \fBWARNING\fP: this makes the transfer insecure.
  1396. Example:
  1397. .nf
  1398. curl --insecure https://example.com
  1399. .fi
  1400. See also \fI--proxy-insecure\fP and \fI--cacert\fP.
  1401. .IP "\-\-interface <name>"
  1402. Perform an operation using a specified interface. You can enter interface
  1403. name, IP address or host name. An example could look like:
  1404. curl \-\-interface eth0:1 https://www.example.com/
  1405. If this option is used several times, the last one will be used.
  1406. On Linux it can be used to specify a VRF, but the binary needs to either
  1407. have CAP_NET_RAW or to be run as root. More information about Linux VRF:
  1408. https://www.kernel.org/doc/Documentation/networking/vrf.txt
  1409. Example:
  1410. .nf
  1411. curl --interface eth0 https://example.com
  1412. .fi
  1413. See also \fI--dns-interface\fP.
  1414. .IP "\-4, \-\-ipv4"
  1415. This option tells curl to resolve names to IPv4 addresses only, and not for
  1416. example try IPv6.
  1417. Example:
  1418. .nf
  1419. curl --ipv4 https://example.com
  1420. .fi
  1421. See also \fI--http1.1\fP and \fI--http2\fP. This option overrides \fI-6, --ipv6\fP.
  1422. .IP "\-6, \-\-ipv6"
  1423. This option tells curl to resolve names to IPv6 addresses only, and not for
  1424. example try IPv4.
  1425. Example:
  1426. .nf
  1427. curl --ipv6 https://example.com
  1428. .fi
  1429. See also \fI--http1.1\fP and \fI--http2\fP. This option overrides \fI-4, --ipv4\fP.
  1430. .IP "\-j, \-\-junk-session-cookies"
  1431. (HTTP) When curl is told to read cookies from a given file, this option will make it
  1432. discard all "session cookies". This will basically have the same effect as if
  1433. a new session is started. Typical browsers always discard session cookies when
  1434. they are closed down.
  1435. Example:
  1436. .nf
  1437. curl --junk-session-cookies -b cookies.txt https://example.com
  1438. .fi
  1439. See also \fI-b, --cookie\fP and \fI-c, --cookie-jar\fP.
  1440. .IP "\-\-keepalive-time <seconds>"
  1441. This option sets the time a connection needs to remain idle before sending
  1442. keepalive probes and the time between individual keepalive probes. It is
  1443. currently effective on operating systems offering the TCP_KEEPIDLE and
  1444. TCP_KEEPINTVL socket options (meaning Linux, recent AIX, HP-UX and more). This
  1445. option has no effect if \fI\-\-no-keepalive\fP is used.
  1446. If this option is used several times, the last one will be used. If
  1447. unspecified, the option defaults to 60 seconds.
  1448. Example:
  1449. .nf
  1450. curl --keepalive-time 20 https://example.com
  1451. .fi
  1452. .IP "\-\-key-type <type>"
  1453. (TLS) Private key file type. Specify which type your \fI\-\-key\fP provided private key
  1454. is. DER, PEM, and ENG are supported. If not specified, PEM is assumed.
  1455. If this option is used several times, the last one will be used.
  1456. Example:
  1457. .nf
  1458. curl --key-type DER --key here https://example.com
  1459. .fi
  1460. .IP "\-\-key <key>"
  1461. (TLS SSH) Private key file name. Allows you to provide your private key in this separate
  1462. file. For SSH, if not specified, curl tries the following candidates in order:
  1463. \&\(aq~/.ssh/id_rsa', '~/.ssh/id_dsa', './id_rsa', './id_dsa'.
  1464. If curl is built against OpenSSL library, and the engine pkcs11 is available,
  1465. then a PKCS#11 URI (RFC 7512) can be used to specify a private key located in a
  1466. PKCS#11 device. A string beginning with "pkcs11:" will be interpreted as a
  1467. PKCS#11 URI. If a PKCS#11 URI is provided, then the \fI\-\-engine\fP option will be set
  1468. as "pkcs11" if none was provided and the \fI\-\-key-type\fP option will be set as
  1469. "ENG" if none was provided.
  1470. If this option is used several times, the last one will be used.
  1471. Example:
  1472. .nf
  1473. curl --cert certificate --key here https://example.com
  1474. .fi
  1475. .IP "\-\-krb <level>"
  1476. (FTP) Enable Kerberos authentication and use. The level must be entered and should
  1477. be one of \(aqclear', 'safe', 'confidential', or 'private'. Should you use a
  1478. level that is not one of these, \(aqprivate' will instead be used.
  1479. If this option is used several times, the last one will be used.
  1480. Example:
  1481. .nf
  1482. curl --krb clear ftp://example.com/
  1483. .fi
  1484. \fI--krb\fP requires that the underlying libcurl was built to support Kerberos.
  1485. .IP "\-\-libcurl <file>"
  1486. Append this option to any ordinary curl command line, and you will get
  1487. libcurl-using C source code written to the file that does the equivalent
  1488. of what your command-line operation does!
  1489. This option is global and does not need to be specified for each use of
  1490. \fI\-:, \-\-next\fP.
  1491. If this option is used several times, the last given file name will be
  1492. used.
  1493. Example:
  1494. .nf
  1495. curl --libcurl client.c https://example.com
  1496. .fi
  1497. .IP "\-\-limit-rate <speed>"
  1498. Specify the maximum transfer rate you want curl to use \- for both downloads
  1499. and uploads. This feature is useful if you have a limited pipe and you would like
  1500. your transfer not to use your entire bandwidth. To make it slower than it
  1501. otherwise would be.
  1502. The given speed is measured in bytes/second, unless a suffix is appended.
  1503. Appending \(aqk' or 'K' will count the number as kilobytes, 'm' or 'M' makes it
  1504. megabytes, while \(aqg' or 'G' makes it gigabytes. The suffixes (k, M, G, T, P)
  1505. are 1024 based. For example 1k is 1024. Examples: 200K, 3m and 1G.
  1506. The rate limiting logic works on averaging the transfer speed to no more than
  1507. the set threshold over a period of multiple seconds.
  1508. If you also use the \fI\-Y, \-\-speed-limit\fP option, that option will take precedence and
  1509. might cripple the rate-limiting slightly, to help keeping the speed-limit
  1510. logic working.
  1511. If this option is used several times, the last one will be used.
  1512. Examples:
  1513. .nf
  1514. curl --limit-rate 100K https://example.com
  1515. curl --limit-rate 1000 https://example.com
  1516. curl --limit-rate 10M https://example.com
  1517. .fi
  1518. .IP "\-l, \-\-list-only"
  1519. (FTP POP3) (FTP)
  1520. When listing an FTP directory, this switch forces a name-only view. This is
  1521. especially useful if the user wants to machine-parse the contents of an FTP
  1522. directory since the normal directory view does not use a standard look or
  1523. format. When used like this, the option causes an NLST command to be sent to
  1524. the server instead of LIST.
  1525. Note: Some FTP servers list only files in their response to NLST; they do not
  1526. include sub-directories and symbolic links.
  1527. (POP3)
  1528. When retrieving a specific email from POP3, this switch forces a LIST command
  1529. to be performed instead of RETR. This is particularly useful if the user wants
  1530. to see if a specific message-id exists on the server and what size it is.
  1531. Note: When combined with \fI\-X, \-\-request\fP, this option can be used to send a UIDL
  1532. command instead, so the user may use the email\(aqs unique identifier rather than
  1533. its message-id to make the request.
  1534. Example:
  1535. .nf
  1536. curl --list-only ftp://example.com/dir/
  1537. .fi
  1538. .IP "\-\-local-port <num/range>"
  1539. Set a preferred single number or range (FROM-TO) of local port numbers to use
  1540. for the connection(s). Note that port numbers by nature are a scarce resource
  1541. that will be busy at times so setting this range to something too narrow might
  1542. cause unnecessary connection setup failures.
  1543. Example:
  1544. .nf
  1545. curl --local-port 1000-3000 https://example.com
  1546. .fi
  1547. .IP "\-\-location-trusted"
  1548. (HTTP) Like \fI\-L, \-\-location\fP, but will allow sending the name + password to all hosts that
  1549. the site may redirect to. This may or may not introduce a security breach if
  1550. the site redirects you to a site to which you will send your authentication
  1551. info (which is plaintext in the case of HTTP Basic authentication).
  1552. Example:
  1553. .nf
  1554. curl --location-trusted -u user:password https://example.com
  1555. .fi
  1556. See also \fI-u, --user\fP.
  1557. .IP "\-L, \-\-location"
  1558. (HTTP) If the server reports that the requested page has moved to a different
  1559. location (indicated with a Location: header and a 3XX response code), this
  1560. option will make curl redo the request on the new place. If used together with
  1561. \fI\-i, \-\-include\fP or \fI\-I, \-\-head\fP, headers from all requested pages will be shown. When
  1562. authentication is used, curl only sends its credentials to the initial
  1563. host. If a redirect takes curl to a different host, it will not be able to
  1564. intercept the user+password. See also \fI\-\-location-trusted\fP on how to change
  1565. this. You can limit the amount of redirects to follow by using the
  1566. \fI\-\-max-redirs\fP option.
  1567. When curl follows a redirect and if the request is a POST, it will send the
  1568. following request with a GET if the HTTP response was 301, 302, or 303. If the
  1569. response code was any other 3xx code, curl will re-send the following request
  1570. using the same unmodified method.
  1571. You can tell curl to not change POST requests to GET after a 30x response by
  1572. using the dedicated options for that: \fI\-\-post301\fP, \fI\-\-post302\fP and \fI\-\-post303\fP.
  1573. The method set with \fI\-X, \-\-request\fP overrides the method curl would otherwise select
  1574. to use.
  1575. Example:
  1576. .nf
  1577. curl -L https://example.com
  1578. .fi
  1579. .IP "\-\-login-options <options>"
  1580. (IMAP POP3 SMTP) Specify the login options to use during server authentication.
  1581. You can use login options to specify protocol specific options that may be
  1582. used during authentication. At present only IMAP, POP3 and SMTP support
  1583. login options. For more information about login options please see RFC
  1584. 2384, RFC 5092 and IETF draft draft-earhart-url-smtp-00.txt
  1585. If this option is used several times, the last one will be used.
  1586. Example:
  1587. .nf
  1588. curl --login-options 'AUTH=*' imap://example.com
  1589. .fi
  1590. Added in 7.34.0.
  1591. .IP "\-\-mail-auth <address>"
  1592. (SMTP) Specify a single address. This will be used to specify the authentication
  1593. address (identity) of a submitted message that is being relayed to another
  1594. server.
  1595. Example:
  1596. .nf
  1597. curl --mail-auth [email protected] -T mail smtp://example.com/
  1598. .fi
  1599. See also \fI--mail-rcpt\fP and \fI--mail-from\fP.
  1600. .IP "\-\-mail-from <address>"
  1601. (SMTP) Specify a single address that the given mail should get sent from.
  1602. Example:
  1603. .nf
  1604. curl --mail-from [email protected] -T mail smtp://example.com/
  1605. .fi
  1606. See also \fI--mail-rcpt\fP and \fI--mail-auth\fP.
  1607. .IP "\-\-mail-rcpt-allowfails"
  1608. (SMTP) When sending data to multiple recipients, by default curl will abort SMTP
  1609. conversation if at least one of the recipients causes RCPT TO command to
  1610. return an error.
  1611. The default behavior can be changed by passing \fI\-\-mail-rcpt-allowfails\fP
  1612. command-line option which will make curl ignore errors and proceed with the
  1613. remaining valid recipients.
  1614. If all recipients trigger RCPT TO failures and this flag is specified, curl
  1615. will still abort the SMTP conversation and return the error received from to
  1616. the last RCPT TO command.
  1617. Example:
  1618. .nf
  1619. curl --mail-rcpt-allowfails --mail-rcpt [email protected] smtp://example.com
  1620. .fi
  1621. Added in 7.69.0.
  1622. .IP "\-\-mail-rcpt <address>"
  1623. (SMTP) Specify a single e-mail address, user name or mailing list name. Repeat this
  1624. option several times to send to multiple recipients.
  1625. When performing an address verification (VRFY command), the recipient should be
  1626. specified as the user name or user name and domain (as per Section 3.5 of
  1627. RFC5321). (Added in 7.34.0)
  1628. When performing a mailing list expand (EXPN command), the recipient should be
  1629. specified using the mailing list name, such as "Friends" or "London-Office".
  1630. (Added in 7.34.0)
  1631. Example:
  1632. .nf
  1633. curl --mail-rcpt [email protected] smtp://example.com
  1634. .fi
  1635. .IP "\-M, \-\-manual"
  1636. Manual. Display the huge help text.
  1637. Example:
  1638. .nf
  1639. curl --manual
  1640. .fi
  1641. .IP "\-\-max-filesize <bytes>"
  1642. (FTP HTTP MQTT) Specify the maximum size (in bytes) of a file to download. If the file
  1643. requested is larger than this value, the transfer will not start and curl will
  1644. return with exit code 63.
  1645. A size modifier may be used. For example, Appending \(aqk' or 'K' will count the
  1646. number as kilobytes, \(aqm' or 'M' makes it megabytes, while 'g' or 'G' makes it
  1647. gigabytes. Examples: 200K, 3m and 1G. (Added in 7.58.0)
  1648. \fBNOTE\fP: The file size is not always known prior to download, and for such
  1649. files this option has no effect even if the file transfer ends up being larger
  1650. than this given limit.
  1651. Example:
  1652. .nf
  1653. curl --max-filesize 100K https://example.com
  1654. .fi
  1655. See also \fI--limit-rate\fP.
  1656. .IP "\-\-max-redirs <num>"
  1657. (HTTP) Set maximum number of redirections to follow. When \fI\-L, \-\-location\fP is used, to
  1658. prevent curl from following too many redirects, by default, the limit is
  1659. set to 50 redirects. Set this option to \-1 to make it unlimited.
  1660. If this option is used several times, the last one will be used.
  1661. Example:
  1662. .nf
  1663. curl --max-redirs 3 --location https://example.com
  1664. .fi
  1665. .IP "\-m, \-\-max-time <fractional seconds>"
  1666. Maximum time in seconds that you allow the whole operation to take. This is
  1667. useful for preventing your batch jobs from hanging for hours due to slow
  1668. networks or links going down. Since 7.32.0, this option accepts decimal
  1669. values, but the actual timeout will decrease in accuracy as the specified
  1670. timeout increases in decimal precision.
  1671. If this option is used several times, the last one will be used.
  1672. Examples:
  1673. .nf
  1674. curl --max-time 10 https://example.com
  1675. curl --max-time 2.92 https://example.com
  1676. .fi
  1677. See also \fI--connect-timeout\fP.
  1678. .IP "\-\-metalink"
  1679. This option was previously used to specify a metalink resource. Metalink
  1680. support has been disabled in curl since 7.78.0 for security reasons.
  1681. Example:
  1682. .nf
  1683. curl --metalink file https://example.com
  1684. .fi
  1685. .IP "\-\-negotiate"
  1686. (HTTP) Enables Negotiate (SPNEGO) authentication.
  1687. This option requires a library built with GSS-API or SSPI support. Use
  1688. \fI\-V, \-\-version\fP to see if your curl supports GSS-API/SSPI or SPNEGO.
  1689. When using this option, you must also provide a fake \fI\-u, \-\-user\fP option to activate
  1690. the authentication code properly. Sending a \(aq-u :' is enough as the user name
  1691. and password from the \fI\-u, \-\-user\fP option are not actually used.
  1692. If this option is used several times, only the first one is used.
  1693. Example:
  1694. .nf
  1695. curl --negotiate -u : https://example.com
  1696. .fi
  1697. See also \fI--basic\fP, \fI--ntlm\fP, \fI--anyauth\fP and \fI--proxy-negotiate\fP.
  1698. .IP "\-\-netrc-file <filename>"
  1699. This option is similar to \fI\-n, \-\-netrc\fP, except that you provide the path (absolute
  1700. or relative) to the netrc file that curl should use. You can only specify one
  1701. netrc file per invocation. If several \fI\-\-netrc-file\fP options are provided,
  1702. the last one will be used.
  1703. It will abide by \fI\-\-netrc-optional\fP if specified.
  1704. Example:
  1705. .nf
  1706. curl --netrc-file netrc https://example.com
  1707. .fi
  1708. This option overrides \fI-n, --netrc\fP.
  1709. .IP "\-\-netrc-optional"
  1710. Similar to \fI\-n, \-\-netrc\fP, but this option makes the .netrc usage \fBoptional\fP
  1711. and not mandatory as the \fI\-n, \-\-netrc\fP option does.
  1712. Example:
  1713. .nf
  1714. curl --netrc-optional https://example.com
  1715. .fi
  1716. See also \fI--netrc-file\fP. This option overrides \fI-n, --netrc\fP.
  1717. .IP "\-n, \-\-netrc"
  1718. Makes curl scan the \fI.netrc\fP (\fI_netrc\fP on Windows) file in the user\(aqs home
  1719. directory for login name and password. This is typically used for FTP on
  1720. Unix. If used with HTTP, curl will enable user authentication. See
  1721. \fInetrc(5)\fP and \fIftp(1)\fP for details on the file format. Curl will not
  1722. complain if that file does not have the right permissions (it should be
  1723. neither world- nor group-readable). The environment variable "HOME" is used
  1724. to find the home directory.
  1725. A quick and simple example of how to setup a \fI.netrc\fP to allow curl to FTP to
  1726. the machine host.domain.com with user name \&\(aqmyself' and password \&'secret'
  1727. should look similar to:
  1728. .B "machine host.domain.com login myself password secret"
  1729. Example:
  1730. .nf
  1731. curl --netrc https://example.com
  1732. .fi
  1733. .IP "\-:, \-\-next"
  1734. Tells curl to use a separate operation for the following URL and associated
  1735. options. This allows you to send several URL requests, each with their own
  1736. specific options, for example, such as different user names or custom requests
  1737. for each.
  1738. \fI\-:, \-\-next\fP will reset all local options and only global ones will have their
  1739. values survive over to the operation following the \fI\-:, \-\-next\fP instruction. Global
  1740. options include \fI\-v, \-\-verbose\fP, \fI\-\-trace\fP, \fI\-\-trace-ascii\fP and \fI\-\-fail-early\fP.
  1741. For example, you can do both a GET and a POST in a single command line:
  1742. .nf
  1743. curl www1.example.com \-\-next \-d postthis www2.example.com
  1744. .fi
  1745. Examples:
  1746. .nf
  1747. curl https://example.com --next -d postthis www2.example.com
  1748. curl -I https://example.com --next https://example.net/
  1749. .fi
  1750. Added in 7.36.0.
  1751. .IP "\-\-no-alpn"
  1752. (HTTPS) Disable the ALPN TLS extension. ALPN is enabled by default if libcurl was built
  1753. with an SSL library that supports ALPN. ALPN is used by a libcurl that supports
  1754. HTTP/2 to negotiate HTTP/2 support with the server during https sessions.
  1755. Example:
  1756. .nf
  1757. curl --no-alpn https://example.com
  1758. .fi
  1759. See also \fI--no-npn\fP and \fI--http2\fP. \fI--no-alpn\fP requires that the underlying libcurl was built to support TLS. Added in 7.36.0.
  1760. .IP "\-N, \-\-no-buffer"
  1761. Disables the buffering of the output stream. In normal work situations, curl
  1762. will use a standard buffered output stream that will have the effect that it
  1763. will output the data in chunks, not necessarily exactly when the data arrives.
  1764. Using this option will disable that buffering.
  1765. Note that this is the negated option name documented. You can thus use
  1766. \-\-buffer to enforce the buffering.
  1767. Example:
  1768. .nf
  1769. curl --no-buffer https://example.com
  1770. .fi
  1771. .IP "\-\-no-keepalive"
  1772. Disables the use of keepalive messages on the TCP connection. curl otherwise
  1773. enables them by default.
  1774. Note that this is the negated option name documented. You can thus use
  1775. \-\-keepalive to enforce keepalive.
  1776. Example:
  1777. .nf
  1778. curl --no-keepalive https://example.com
  1779. .fi
  1780. .IP "\-\-no-npn"
  1781. (HTTPS) Disable the NPN TLS extension. NPN is enabled by default if libcurl was built
  1782. with an SSL library that supports NPN. NPN is used by a libcurl that supports
  1783. HTTP/2 to negotiate HTTP/2 support with the server during https sessions.
  1784. Example:
  1785. .nf
  1786. curl --no-npn https://example.com
  1787. .fi
  1788. See also \fI--no-alpn\fP and \fI--http2\fP. \fI--no-npn\fP requires that the underlying libcurl was built to support TLS. Added in 7.36.0.
  1789. .IP "\-\-no-progress-meter"
  1790. Option to switch off the progress meter output without muting or otherwise
  1791. affecting warning and informational messages like \fI\-s, \-\-silent\fP does.
  1792. Note that this is the negated option name documented. You can thus use
  1793. \-\-progress-meter to enable the progress meter again.
  1794. Example:
  1795. .nf
  1796. curl --no-progress-meter -o store https://example.com
  1797. .fi
  1798. See also \fI-v, --verbose\fP and \fI-s, --silent\fP. Added in 7.67.0.
  1799. .IP "\-\-no-sessionid"
  1800. (TLS) Disable curl\(aqs use of SSL session-ID caching. By default all transfers are
  1801. done using the cache. Note that while nothing should ever get hurt by
  1802. attempting to reuse SSL session-IDs, there seem to be broken SSL
  1803. implementations in the wild that may require you to disable this in order for
  1804. you to succeed.
  1805. Note that this is the negated option name documented. You can thus use
  1806. \-\-sessionid to enforce session-ID caching.
  1807. Example:
  1808. .nf
  1809. curl --no-sessionid https://example.com
  1810. .fi
  1811. .IP "\-\-noproxy <no-proxy-list>"
  1812. Comma-separated list of hosts for which not to use a proxy, if one is
  1813. specified. The only wildcard is a single * character, which matches all hosts,
  1814. and effectively disables the proxy. Each name in this list is matched as
  1815. either a domain which contains the hostname, or the hostname itself. For
  1816. example, local.com would match local.com, local.com:80, and www.local.com, but
  1817. not www.notlocal.com.
  1818. Since 7.53.0, This option overrides the environment variables that disable the
  1819. proxy (\(aqno_proxy' and 'NO_PROXY'). If there's an environment variable
  1820. disabling a proxy, you can set the noproxy list to \&"" to override it.
  1821. Example:
  1822. .nf
  1823. curl --noproxy "www.example" https://example.com
  1824. .fi
  1825. .IP "\-\-ntlm-wb"
  1826. (HTTP) Enables NTLM much in the style \fI\-\-ntlm\fP does, but hand over the authentication
  1827. to the separate binary ntlmauth application that is executed when needed.
  1828. Example:
  1829. .nf
  1830. curl --ntlm-wb -u user:password https://example.com
  1831. .fi
  1832. See also \fI--ntlm\fP and \fI--proxy-ntlm\fP.
  1833. .IP "\-\-ntlm"
  1834. (HTTP) Enables NTLM authentication. The NTLM authentication method was designed by
  1835. Microsoft and is used by IIS web servers. It is a proprietary protocol,
  1836. reverse-engineered by clever people and implemented in curl based on their
  1837. efforts. This kind of behavior should not be endorsed, you should encourage
  1838. everyone who uses NTLM to switch to a public and documented authentication
  1839. method instead, such as Digest.
  1840. If you want to enable NTLM for your proxy authentication, then use
  1841. \fI\-\-proxy-ntlm\fP.
  1842. If this option is used several times, only the first one is used.
  1843. Example:
  1844. .nf
  1845. curl --ntlm -u user:password https://example.com
  1846. .fi
  1847. See also \fI--proxy-ntlm\fP. \fI--ntlm\fP requires that the underlying libcurl was built to support TLS. This option overrides \fI--basic\fP and \fI--negotiate\fP and \fI--digest\fP and \fI--anyauth\fP.
  1848. .IP "\-\-oauth2-bearer <token>"
  1849. (IMAP POP3 SMTP HTTP) Specify the Bearer Token for OAUTH 2.0 server authentication. The Bearer Token
  1850. is used in conjunction with the user name which can be specified as part of
  1851. the \fI\-\-url\fP or \fI\-u, \-\-user\fP options.
  1852. The Bearer Token and user name are formatted according to RFC 6750.
  1853. If this option is used several times, the last one will be used.
  1854. Example:
  1855. .nf
  1856. curl --oauth2-bearer "mF_9.B5f-4.1JqM" https://example.com
  1857. .fi
  1858. Added in 7.33.0.
  1859. .IP "\-\-output-dir <dir>"
  1860. This option specifies the directory in which files should be stored, when
  1861. \fI\-O, \-\-remote-name\fP or \fI\-o, \-\-output\fP are used.
  1862. The given output directory is used for all URLs and output options on the
  1863. command line, up until the first \fI\-:, \-\-next\fP.
  1864. If the specified target directory does not exist, the operation will fail
  1865. unless \fI\-\-create-dirs\fP is also used.
  1866. If this option is used multiple times, the last specified directory will be
  1867. used.
  1868. Example:
  1869. .nf
  1870. curl --output-dir "tmp" -O https://example.com
  1871. .fi
  1872. See also \fI-O, --remote-name\fP and \fI-J, --remote-header-name\fP. Added in 7.73.0.
  1873. .IP "\-o, \-\-output <file>"
  1874. Write output to <file> instead of stdout. If you are using {} or [] to fetch
  1875. multiple documents, you should quote the URL and you can use \(aq#' followed by a
  1876. number in the <file> specifier. That variable will be replaced with the current
  1877. string for the URL being fetched. Like in:
  1878. curl "http://{one,two}.example.com" \-o "file_#1.txt"
  1879. or use several variables like:
  1880. curl "http://{site,host}.host[1-5].com" \-o "#1_#2"
  1881. You may use this option as many times as the number of URLs you have. For
  1882. example, if you specify two URLs on the same command line, you can use it like
  1883. this:
  1884. curl \-o aa example.com \-o bb example.net
  1885. and the order of the \-o options and the URLs does not matter, just that the
  1886. first \-o is for the first URL and so on, so the above command line can also be
  1887. written as
  1888. curl example.com example.net \-o aa \-o bb
  1889. See also the \fI\-\-create-dirs\fP option to create the local directories
  1890. dynamically. Specifying the output as \(aq-' (a single dash) will force the
  1891. output to be done to stdout.
  1892. To suppress response bodies, you can redirect output to /dev/null:
  1893. curl example.com \-o /dev/null
  1894. Or for Windows use nul:
  1895. curl example.com \-o nul
  1896. Examples:
  1897. .nf
  1898. curl -o file https://example.com
  1899. curl "http://{one,two}.example.com" -o "file_#1.txt"
  1900. curl "http://{site,host}.host[1-5].com" -o "#1_#2"
  1901. curl -o file https://example.com -o file2 https://example.net
  1902. .fi
  1903. See also \fI-O, --remote-name\fP, \fI--remote-name-all\fP and \fI-J, --remote-header-name\fP.
  1904. .IP "\-\-parallel-immediate"
  1905. When doing parallel transfers, this option will instruct curl that it should
  1906. rather prefer opening up more connections in parallel at once rather than
  1907. waiting to see if new transfers can be added as multiplexed streams on another
  1908. connection.
  1909. This option is global and does not need to be specified for each use of
  1910. \fI\-:, \-\-next\fP.
  1911. Example:
  1912. .nf
  1913. curl --parallel-immediate -Z https://example.com -o file1 https://example.com -o file2
  1914. .fi
  1915. See also \fI-Z, --parallel\fP and \fI--parallel-max\fP. Added in 7.68.0.
  1916. .IP "\-\-parallel-max <num>"
  1917. When asked to do parallel transfers, using \fI\-Z, \-\-parallel\fP, this option controls
  1918. the maximum amount of transfers to do simultaneously.
  1919. This option is global and does not need to be specified for each use of
  1920. \fI\-:, \-\-next\fP.
  1921. The default is 50.
  1922. Example:
  1923. .nf
  1924. curl --parallel-max 100 -Z https://example.com ftp://example.com/
  1925. .fi
  1926. See also \fI-Z, --parallel\fP. Added in 7.66.0.
  1927. .IP "\-Z, \-\-parallel"
  1928. Makes curl perform its transfers in parallel as compared to the regular serial
  1929. manner.
  1930. This option is global and does not need to be specified for each use of
  1931. \fI\-:, \-\-next\fP.
  1932. Example:
  1933. .nf
  1934. curl --parallel https://example.com -o file1 https://example.com -o file2
  1935. .fi
  1936. Added in 7.66.0.
  1937. .IP "\-\-pass <phrase>"
  1938. (SSH TLS) Passphrase for the private key.
  1939. If this option is used several times, the last one will be used.
  1940. Example:
  1941. .nf
  1942. curl --pass secret --key file https://example.com
  1943. .fi
  1944. .IP "\-\-path-as-is"
  1945. Tell curl to not handle sequences of /../ or /./ in the given URL
  1946. path. Normally curl will squash or merge them according to standards but with
  1947. this option set you tell it not to do that.
  1948. Example:
  1949. .nf
  1950. curl --path-as-is https://example.com/../../etc/passwd
  1951. .fi
  1952. Added in 7.42.0.
  1953. .IP "\-\-pinnedpubkey <hashes>"
  1954. (TLS) Tells curl to use the specified public key file (or hashes) to verify the
  1955. peer. This can be a path to a file which contains a single public key in PEM
  1956. or DER format, or any number of base64 encoded sha256 hashes preceded by
  1957. \(aqsha256//' and separated by ';'.
  1958. When negotiating a TLS or SSL connection, the server sends a certificate
  1959. indicating its identity. A public key is extracted from this certificate and
  1960. if it does not exactly match the public key provided to this option, curl will
  1961. abort the connection before sending or receiving any data.
  1962. PEM/DER support:
  1963. 7.39.0: OpenSSL, GnuTLS and GSKit
  1964. 7.43.0: NSS and wolfSSL
  1965. 7.47.0: mbedtls
  1966. sha256 support:
  1967. 7.44.0: OpenSSL, GnuTLS, NSS and wolfSSL
  1968. 7.47.0: mbedtls
  1969. Other SSL backends not supported.
  1970. If this option is used several times, the last one will be used.
  1971. Examples:
  1972. .nf
  1973. curl --pinnedpubkey keyfile https://example.com
  1974. curl --pinnedpubkey 'sha256//ce118b51897f4452dc' https://example.com
  1975. .fi
  1976. Added in 7.39.0.
  1977. .IP "\-\-post301"
  1978. (HTTP) Tells curl to respect RFC 7231/6.4.2 and not convert POST requests into GET
  1979. requests when following a 301 redirection. The non-RFC behavior is ubiquitous
  1980. in web browsers, so curl does the conversion by default to maintain
  1981. consistency. However, a server may require a POST to remain a POST after such
  1982. a redirection. This option is meaningful only when using \fI\-L, \-\-location\fP.
  1983. Example:
  1984. .nf
  1985. curl --post301 --location -d "data" https://example.com
  1986. .fi
  1987. See also \fI--post302\fP, \fI--post303\fP and \fI-L, --location\fP.
  1988. .IP "\-\-post302"
  1989. (HTTP) Tells curl to respect RFC 7231/6.4.3 and not convert POST requests into GET
  1990. requests when following a 302 redirection. The non-RFC behavior is ubiquitous
  1991. in web browsers, so curl does the conversion by default to maintain
  1992. consistency. However, a server may require a POST to remain a POST after such
  1993. a redirection. This option is meaningful only when using \fI\-L, \-\-location\fP.
  1994. Example:
  1995. .nf
  1996. curl --post302 --location -d "data" https://example.com
  1997. .fi
  1998. See also \fI--post301\fP, \fI--post303\fP and \fI-L, --location\fP.
  1999. .IP "\-\-post303"
  2000. (HTTP) Tells curl to violate RFC 7231/6.4.4 and not convert POST requests into GET
  2001. requests when following 303 redirections. A server may require a POST to
  2002. remain a POST after a 303 redirection. This option is meaningful only when
  2003. using \fI\-L, \-\-location\fP.
  2004. Example:
  2005. .nf
  2006. curl --post303 --location -d "data" https://example.com
  2007. .fi
  2008. See also \fI--post302\fP, \fI--post301\fP and \fI-L, --location\fP.
  2009. .IP "\-\-preproxy [protocol://]host[:port]"
  2010. Use the specified SOCKS proxy before connecting to an HTTP or HTTPS \fI\-x, \-\-proxy\fP. In
  2011. such a case curl first connects to the SOCKS proxy and then connects (through
  2012. SOCKS) to the HTTP or HTTPS proxy. Hence pre proxy.
  2013. The pre proxy string should be specified with a protocol:// prefix to specify
  2014. alternative proxy protocols. Use socks4://, socks4a://, socks5:// or
  2015. socks5h:// to request the specific SOCKS version to be used. No protocol
  2016. specified will make curl default to SOCKS4.
  2017. If the port number is not specified in the proxy string, it is assumed to be
  2018. 1080.
  2019. User and password that might be provided in the proxy string are URL decoded
  2020. by curl. This allows you to pass in special characters such as @ by using %40
  2021. or pass in a colon with %3a.
  2022. If this option is used several times, the last one will be used.
  2023. Example:
  2024. .nf
  2025. curl --preproxy socks5://proxy.example -x http://http.example https://example.com
  2026. .fi
  2027. Added in 7.52.0.
  2028. .IP "\-#, \-\-progress-bar"
  2029. Make curl display transfer progress as a simple progress bar instead of the
  2030. standard, more informational, meter.
  2031. This progress bar draws a single line of \(aq#' characters across the screen and
  2032. shows a percentage if the transfer size is known. For transfers without a
  2033. known size, there will be space ship (-=o=-) that moves back and forth but
  2034. only while data is being transferred, with a set of flying hash sign symbols on
  2035. top.
  2036. This option is global and does not need to be specified for each use of
  2037. \fI\-:, \-\-next\fP.
  2038. Example:
  2039. .nf
  2040. curl -# -O https://example.com
  2041. .fi
  2042. .IP "\-\-proto-default <protocol>"
  2043. Tells curl to use \fIprotocol\fP for any URL missing a scheme name.
  2044. An unknown or unsupported protocol causes error
  2045. \fICURLE_UNSUPPORTED_PROTOCOL\fP (1).
  2046. This option does not change the default proxy protocol (http).
  2047. Without this option set, curl guesses protocol based on the host name, see
  2048. \fI\-\-url\fP for details.
  2049. Example:
  2050. .nf
  2051. curl --proto-default https ftp.example.com
  2052. .fi
  2053. Added in 7.45.0.
  2054. .IP "\-\-proto-redir <protocols>"
  2055. Tells curl to limit what protocols it may use on redirect. Protocols denied by
  2056. \fI\-\-proto\fP are not overridden by this option. See \-\-proto for how protocols are
  2057. represented.
  2058. Example, allow only HTTP and HTTPS on redirect:
  2059. curl \-\-proto-redir \-all,http,https http://example.com
  2060. By default curl will only allow HTTP, HTTPS, FTP and FTPS on redirect (since
  2061. 7.65.2). Specifying \fIall\fP or \fI+all\fP enables all protocols on redirects, which
  2062. is not good for security.
  2063. Example:
  2064. .nf
  2065. curl --proto-redir =http,https https://example.com
  2066. .fi
  2067. .IP "\-\-proto <protocols>"
  2068. Tells curl to limit what protocols it may use for transfers. Protocols are
  2069. evaluated left to right, are comma separated, and are each a protocol name or
  2070. \&\(aqall', optionally prefixed by zero or more modifiers. Available modifiers are:
  2071. .RS
  2072. .TP 3
  2073. .B +
  2074. Permit this protocol in addition to protocols already permitted (this is
  2075. the default if no modifier is used).
  2076. .TP
  2077. .B \-
  2078. Deny this protocol, removing it from the list of protocols already permitted.
  2079. .TP
  2080. .B =
  2081. Permit only this protocol (ignoring the list already permitted), though
  2082. subject to later modification by subsequent entries in the comma separated
  2083. list.
  2084. .RE
  2085. .IP
  2086. For example:
  2087. .RS
  2088. .TP 15
  2089. .B \fI\-\-proto\fP \-ftps
  2090. uses the default protocols, but disables ftps
  2091. .TP
  2092. .B \fI\-\-proto\fP \-all,https,+http
  2093. only enables http and https
  2094. .TP
  2095. .B \fI\-\-proto\fP =http,https
  2096. also only enables http and https
  2097. .RE
  2098. .IP
  2099. Unknown protocols produce a warning. This allows scripts to safely rely on
  2100. being able to disable potentially dangerous protocols, without relying upon
  2101. support for that protocol being built into curl to avoid an error.
  2102. This option can be used multiple times, in which case the effect is the same
  2103. as concatenating the protocols into one instance of the option.
  2104. Example:
  2105. .nf
  2106. curl --proto =http,https,sftp https://example.com
  2107. .fi
  2108. See also \fI--proto-redir\fP and \fI--proto-default\fP.
  2109. .IP "\-\-proxy-anyauth"
  2110. Tells curl to pick a suitable authentication method when communicating with
  2111. the given HTTP proxy. This might cause an extra request/response round-trip.
  2112. Example:
  2113. .nf
  2114. curl --proxy-anyauth --proxy-user user:passwd -x proxy https://example.com
  2115. .fi
  2116. See also \fI-x, --proxy\fP, \fI--proxy-basic\fP and \fI--proxy-digest\fP.
  2117. .IP "\-\-proxy-basic"
  2118. Tells curl to use HTTP Basic authentication when communicating with the given
  2119. proxy. Use \fI\-\-basic\fP for enabling HTTP Basic with a remote host. Basic is the
  2120. default authentication method curl uses with proxies.
  2121. Example:
  2122. .nf
  2123. curl --proxy-basic --proxy-user user:passwd -x proxy https://example.com
  2124. .fi
  2125. See also \fI-x, --proxy\fP, \fI--proxy-anyauth\fP and \fI--proxy-digest\fP.
  2126. .IP "\-\-proxy-cacert <file>"
  2127. Same as \fI\-\-cacert\fP but used in HTTPS proxy context.
  2128. Example:
  2129. .nf
  2130. curl --proxy-cacert CA-file.txt -x https://proxy https://example.com
  2131. .fi
  2132. See also \fI--proxy-capath\fP, \fI--cacert\fP, \fI--capath\fP and \fI-x, --proxy\fP. Added in 7.52.0.
  2133. .IP "\-\-proxy-capath <dir>"
  2134. Same as \fI\-\-capath\fP but used in HTTPS proxy context.
  2135. Example:
  2136. .nf
  2137. curl --proxy-capath /local/directory -x https://proxy https://example.com
  2138. .fi
  2139. See also \fI--proxy-cacert\fP, \fI-x, --proxy\fP and \fI--capath\fP. Added in 7.52.0.
  2140. .IP "\-\-proxy-cert-type <type>"
  2141. Same as \fI\-\-cert-type\fP but used in HTTPS proxy context.
  2142. Example:
  2143. .nf
  2144. curl --proxy-cert-type PEM --proxy-cert file -x https://proxy https://example.com
  2145. .fi
  2146. Added in 7.52.0.
  2147. .IP "\-\-proxy-cert <cert[:passwd]>"
  2148. Same as \fI\-E, \-\-cert\fP but used in HTTPS proxy context.
  2149. Example:
  2150. .nf
  2151. curl --proxy-cert file -x https://proxy https://example.com
  2152. .fi
  2153. Added in 7.52.0.
  2154. .IP "\-\-proxy-ciphers <list>"
  2155. Same as \fI\-\-ciphers\fP but used in HTTPS proxy context.
  2156. Example:
  2157. .nf
  2158. curl --proxy-ciphers ECDHE-ECDSA-AES256-CCM8 -x https://proxy https://example.com
  2159. .fi
  2160. Added in 7.52.0.
  2161. .IP "\-\-proxy-crlfile <file>"
  2162. Same as \fI\-\-crlfile\fP but used in HTTPS proxy context.
  2163. Example:
  2164. .nf
  2165. curl --proxy-crlfile rejects.txt -x https://proxy https://example.com
  2166. .fi
  2167. Added in 7.52.0.
  2168. .IP "\-\-proxy-digest"
  2169. Tells curl to use HTTP Digest authentication when communicating with the given
  2170. proxy. Use \fI\-\-digest\fP for enabling HTTP Digest with a remote host.
  2171. Example:
  2172. .nf
  2173. curl --proxy-digest --proxy-user user:passwd -x proxy https://example.com
  2174. .fi
  2175. See also \fI-x, --proxy\fP, \fI--proxy-anyauth\fP and \fI--proxy-basic\fP.
  2176. .IP "\-\-proxy-header <header/@file>"
  2177. (HTTP) Extra header to include in the request when sending HTTP to a proxy. You may
  2178. specify any number of extra headers. This is the equivalent option to \fI\-H, \-\-header\fP
  2179. but is for proxy communication only like in CONNECT requests when you want a
  2180. separate header sent to the proxy to what is sent to the actual remote host.
  2181. curl will make sure that each header you add/replace is sent with the proper
  2182. end-of-line marker, you should thus \fBnot\fP add that as a part of the header
  2183. content: do not add newlines or carriage returns, they will only mess things
  2184. up for you.
  2185. Headers specified with this option will not be included in requests that curl
  2186. knows will not be sent to a proxy.
  2187. Starting in 7.55.0, this option can take an argument in @filename style, which
  2188. then adds a header for each line in the input file. Using @- will make curl
  2189. read the header file from stdin.
  2190. This option can be used multiple times to add/replace/remove multiple headers.
  2191. Examples:
  2192. .nf
  2193. curl --proxy-header "X-First-Name: Joe" -x http://proxy https://example.com
  2194. curl --proxy-header "User-Agent: surprise" -x http://proxy https://example.com
  2195. curl --proxy-header "Host:" -x http://proxy https://example.com
  2196. .fi
  2197. Added in 7.37.0.
  2198. .IP "\-\-proxy-insecure"
  2199. Same as \fI\-k, \-\-insecure\fP but used in HTTPS proxy context.
  2200. Example:
  2201. .nf
  2202. curl --proxy-insecure -x https://proxy https://example.com
  2203. .fi
  2204. Added in 7.52.0.
  2205. .IP "\-\-proxy-key-type <type>"
  2206. Same as \fI\-\-key-type\fP but used in HTTPS proxy context.
  2207. Example:
  2208. .nf
  2209. curl --proxy-key-type DER --proxy-key here -x https://proxy https://example.com
  2210. .fi
  2211. Added in 7.52.0.
  2212. .IP "\-\-proxy-key <key>"
  2213. Same as \fI\-\-key\fP but used in HTTPS proxy context.
  2214. Example:
  2215. .nf
  2216. curl --proxy-key here -x https://proxy https://example.com
  2217. .fi
  2218. Added in 7.52.0.
  2219. .IP "\-\-proxy-negotiate"
  2220. Tells curl to use HTTP Negotiate (SPNEGO) authentication when communicating
  2221. with the given proxy. Use \fI\-\-negotiate\fP for enabling HTTP Negotiate (SPNEGO)
  2222. with a remote host.
  2223. Example:
  2224. .nf
  2225. curl --proxy-negotiate --proxy-user user:passwd -x proxy https://example.com
  2226. .fi
  2227. See also \fI--proxy-anyauth\fP and \fI--proxy-basic\fP.
  2228. .IP "\-\-proxy-ntlm"
  2229. Tells curl to use HTTP NTLM authentication when communicating with the given
  2230. proxy. Use \fI\-\-ntlm\fP for enabling NTLM with a remote host.
  2231. Example:
  2232. .nf
  2233. curl --proxy-ntlm --proxy-user user:passwd -x http://proxy https://example.com
  2234. .fi
  2235. See also \fI--proxy-negotiate\fP and \fI--proxy-anyauth\fP.
  2236. .IP "\-\-proxy-pass <phrase>"
  2237. Same as \fI\-\-pass\fP but used in HTTPS proxy context.
  2238. Example:
  2239. .nf
  2240. curl --proxy-pass secret --proxy-key here -x https://proxy https://example.com
  2241. .fi
  2242. Added in 7.52.0.
  2243. .IP "\-\-proxy-pinnedpubkey <hashes>"
  2244. (TLS) Tells curl to use the specified public key file (or hashes) to verify the
  2245. proxy. This can be a path to a file which contains a single public key in PEM
  2246. or DER format, or any number of base64 encoded sha256 hashes preceded by
  2247. \(aqsha256//' and separated by ';'.
  2248. When negotiating a TLS or SSL connection, the server sends a certificate
  2249. indicating its identity. A public key is extracted from this certificate and
  2250. if it does not exactly match the public key provided to this option, curl will
  2251. abort the connection before sending or receiving any data.
  2252. If this option is used several times, the last one will be used.
  2253. Examples:
  2254. .nf
  2255. curl --proxy-pinnedpubkey keyfile https://example.com
  2256. curl --proxy-pinnedpubkey 'sha256//ce118b51897f4452dc' https://example.com
  2257. .fi
  2258. Added in 7.59.0.
  2259. .IP "\-\-proxy-service-name <name>"
  2260. This option allows you to change the service name for proxy negotiation.
  2261. Example:
  2262. .nf
  2263. curl --proxy-service-name "shrubbery" -x proxy https://example.com
  2264. .fi
  2265. Added in 7.43.0.
  2266. .IP "\-\-proxy-ssl-allow-beast"
  2267. Same as \fI\-\-ssl-allow-beast\fP but used in HTTPS proxy context.
  2268. Example:
  2269. .nf
  2270. curl --proxy-ssl-allow-beast -x https://proxy https://example.com
  2271. .fi
  2272. Added in 7.52.0.
  2273. .IP "\-\-proxy-ssl-auto-client-cert"
  2274. Same as \fI\-\-ssl-auto-client-cert\fP but used in HTTPS proxy context.
  2275. Example:
  2276. .nf
  2277. curl --proxy-ssl-auto-client-cert -x https://proxy https://example.com
  2278. .fi
  2279. Added in 7.77.0.
  2280. .IP "\-\-proxy-tls13-ciphers <ciphersuite list>"
  2281. (TLS) Specifies which cipher suites to use in the connection to your HTTPS proxy
  2282. when it negotiates TLS 1.3. The list of ciphers suites must specify valid
  2283. ciphers. Read up on TLS 1.3 cipher suite details on this URL:
  2284. https://curl.se/docs/ssl-ciphers.html
  2285. This option is currently used only when curl is built to use OpenSSL 1.1.1 or
  2286. later. If you are using a different SSL backend you can try setting TLS 1.3
  2287. cipher suites by using the \fI\-\-proxy-ciphers\fP option.
  2288. If this option is used several times, the last one will be used.
  2289. Example:
  2290. .nf
  2291. curl --proxy-tls13-ciphers TLS_AES_128_GCM_SHA256 -x proxy https://example.com
  2292. .fi
  2293. Added in 7.61.0.
  2294. .IP "\-\-proxy-tlsauthtype <type>"
  2295. Same as \fI\-\-tlsauthtype\fP but used in HTTPS proxy context.
  2296. Example:
  2297. .nf
  2298. curl --proxy-tlsauthtype SRP -x https://proxy https://example.com
  2299. .fi
  2300. Added in 7.52.0.
  2301. .IP "\-\-proxy-tlspassword <string>"
  2302. Same as \fI\-\-tlspassword\fP but used in HTTPS proxy context.
  2303. Example:
  2304. .nf
  2305. curl --proxy-tlspassword passwd -x https://proxy https://example.com
  2306. .fi
  2307. Added in 7.52.0.
  2308. .IP "\-\-proxy-tlsuser <name>"
  2309. Same as \fI\-\-tlsuser\fP but used in HTTPS proxy context.
  2310. Example:
  2311. .nf
  2312. curl --proxy-tlsuser smith -x https://proxy https://example.com
  2313. .fi
  2314. Added in 7.52.0.
  2315. .IP "\-\-proxy-tlsv1"
  2316. Same as \fI\-1, \-\-tlsv1\fP but used in HTTPS proxy context.
  2317. Example:
  2318. .nf
  2319. curl --proxy-tlsv1 -x https://proxy https://example.com
  2320. .fi
  2321. Added in 7.52.0.
  2322. .IP "\-U, \-\-proxy-user <user:password>"
  2323. Specify the user name and password to use for proxy authentication.
  2324. If you use a Windows SSPI-enabled curl binary and do either Negotiate or NTLM
  2325. authentication then you can tell curl to select the user name and password
  2326. from your environment by specifying a single colon with this option: "-U :".
  2327. On systems where it works, curl will hide the given option argument from
  2328. process listings. This is not enough to protect credentials from possibly
  2329. getting seen by other users on the same system as they will still be visible
  2330. for a brief moment before cleared. Such sensitive data should be retrieved
  2331. from a file instead or similar and never used in clear text in a command line.
  2332. If this option is used several times, the last one will be used.
  2333. Example:
  2334. .nf
  2335. curl --proxy-user name:pwd -x proxy https://example.com
  2336. .fi
  2337. .IP "\-x, \-\-proxy [protocol://]host[:port]"
  2338. Use the specified proxy.
  2339. The proxy string can be specified with a protocol:// prefix. No protocol
  2340. specified or http:// will be treated as HTTP proxy. Use socks4://, socks4a://,
  2341. socks5:// or socks5h:// to request a specific SOCKS version to be used.
  2342. HTTPS proxy support via https:// protocol prefix was added in 7.52.0 for
  2343. OpenSSL, GnuTLS and NSS.
  2344. Unrecognized and unsupported proxy protocols cause an error since 7.52.0.
  2345. Prior versions may ignore the protocol and use http:// instead.
  2346. If the port number is not specified in the proxy string, it is assumed to be
  2347. 1080.
  2348. This option overrides existing environment variables that set the proxy to
  2349. use. If there\(aqs an environment variable setting a proxy, you can set proxy to
  2350. \&"" to override it.
  2351. All operations that are performed over an HTTP proxy will transparently be
  2352. converted to HTTP. It means that certain protocol specific operations might
  2353. not be available. This is not the case if you can tunnel through the proxy, as
  2354. one with the \fI\-p, \-\-proxytunnel\fP option.
  2355. User and password that might be provided in the proxy string are URL decoded
  2356. by curl. This allows you to pass in special characters such as @ by using %40
  2357. or pass in a colon with %3a.
  2358. The proxy host can be specified the exact same way as the proxy environment
  2359. variables, including the protocol prefix (http://) and the embedded user +
  2360. password.
  2361. If this option is used several times, the last one will be used.
  2362. Example:
  2363. .nf
  2364. curl --proxy http://proxy.example https://example.com
  2365. .fi
  2366. .IP "\-\-proxy1.0 <host[:port]>"
  2367. Use the specified HTTP 1.0 proxy. If the port number is not specified, it is
  2368. assumed at port 1080.
  2369. The only difference between this and the HTTP proxy option \fI\-x, \-\-proxy\fP, is that
  2370. attempts to use CONNECT through the proxy will specify an HTTP 1.0 protocol
  2371. instead of the default HTTP 1.1.
  2372. Example:
  2373. .nf
  2374. curl --proxy1.0 -x http://proxy https://example.com
  2375. .fi
  2376. .IP "\-p, \-\-proxytunnel"
  2377. When an HTTP proxy is used \fI\-x, \-\-proxy\fP, this option will make curl tunnel through
  2378. the proxy. The tunnel approach is made with the HTTP proxy CONNECT request and
  2379. requires that the proxy allows direct connect to the remote port number curl
  2380. wants to tunnel through to.
  2381. To suppress proxy CONNECT response headers when curl is set to output headers
  2382. use \fI\-\-suppress-connect-headers\fP.
  2383. Example:
  2384. .nf
  2385. curl --proxytunnel -x http://proxy https://example.com
  2386. .fi
  2387. See also \fI-x, --proxy\fP.
  2388. .IP "\-\-pubkey <key>"
  2389. (SFTP SCP) Public key file name. Allows you to provide your public key in this separate
  2390. file.
  2391. If this option is used several times, the last one will be used.
  2392. (As of 7.39.0, curl attempts to automatically extract the public key from the
  2393. private key file, so passing this option is generally not required. Note that
  2394. this public key extraction requires libcurl to be linked against a copy of
  2395. libssh2 1.2.8 or higher that is itself linked against OpenSSL.)
  2396. Example:
  2397. .nf
  2398. curl --pubkey file.pub sftp://example.com/
  2399. .fi
  2400. .IP "\-Q, \-\-quote <command>"
  2401. (FTP SFTP) Send an arbitrary command to the remote FTP or SFTP server. Quote commands are
  2402. sent BEFORE the transfer takes place (just after the initial PWD command in an
  2403. FTP transfer, to be exact). To make commands take place after a successful
  2404. transfer, prefix them with a dash \(aq-'. To make commands be sent after curl
  2405. has changed the working directory, just before the transfer command(s), prefix
  2406. the command with a \(aq+' (this is only supported for FTP). You may specify any
  2407. number of commands.
  2408. By default curl will stop at first failure. To make curl continue even if the
  2409. command fails, prefix the command with an asterisk (*). Otherwise, if the
  2410. server returns failure for one of the commands, the entire operation will be
  2411. aborted.
  2412. You must send syntactically correct FTP commands as RFC 959 defines to FTP
  2413. servers, or one of the commands listed below to SFTP servers.
  2414. This option can be used multiple times.
  2415. SFTP is a binary protocol. Unlike for FTP, curl interprets SFTP quote commands
  2416. itself before sending them to the server. File names may be quoted
  2417. shell-style to embed spaces or special characters. Following is the list of
  2418. all supported SFTP quote commands:
  2419. .RS
  2420. .IP "atime date file"
  2421. The atime command sets the last access time of the file named by the file
  2422. operand. The <date expression> can be all sorts of date strings, see the
  2423. \fIcurl_getdate(3)\fP man page for date expression details. (Added in 7.73.0)
  2424. .IP "chgrp group file"
  2425. The chgrp command sets the group ID of the file named by the file operand to
  2426. the group ID specified by the group operand. The group operand is a decimal
  2427. integer group ID.
  2428. .IP "chmod mode file"
  2429. The chmod command modifies the file mode bits of the specified file. The
  2430. mode operand is an octal integer mode number.
  2431. .IP "chown user file"
  2432. The chown command sets the owner of the file named by the file operand to the
  2433. user ID specified by the user operand. The user operand is a decimal
  2434. integer user ID.
  2435. .IP "ln source_file target_file"
  2436. The ln and symlink commands create a symbolic link at the target_file location
  2437. pointing to the source_file location.
  2438. .IP "mkdir directory_name"
  2439. The mkdir command creates the directory named by the directory_name operand.
  2440. .IP "mtime date file"
  2441. The mtime command sets the last modification time of the file named by the
  2442. file operand. The <date expression> can be all sorts of date strings, see the
  2443. \fIcurl_getdate(3)\fP man page for date expression details. (Added in 7.73.0)
  2444. .IP "pwd"
  2445. The pwd command returns the absolute pathname of the current working directory.
  2446. .IP "rename source target"
  2447. The rename command renames the file or directory named by the source
  2448. operand to the destination path named by the target operand.
  2449. .IP "rm file"
  2450. The rm command removes the file specified by the file operand.
  2451. .IP "rmdir directory"
  2452. The rmdir command removes the directory entry specified by the directory
  2453. operand, provided it is empty.
  2454. .IP "symlink source_file target_file"
  2455. See ln.
  2456. .RE
  2457. Example:
  2458. .nf
  2459. curl --quote "DELE file" ftp://example.com/foo
  2460. .fi
  2461. .IP "\-\-random-file <file>"
  2462. Specify the path name to file containing what will be considered as random
  2463. data. The data may be used to seed the random engine for SSL connections. See
  2464. also the \fI\-\-egd-file\fP option.
  2465. Example:
  2466. .nf
  2467. curl --random-file rubbish https://example.com
  2468. .fi
  2469. .IP "\-r, \-\-range <range>"
  2470. (HTTP FTP SFTP FILE) Retrieve a byte range (i.e. a partial document) from an HTTP/1.1, FTP or SFTP
  2471. server or a local FILE. Ranges can be specified in a number of ways.
  2472. .RS
  2473. .TP 10
  2474. .B 0-499
  2475. specifies the first 500 bytes
  2476. .TP
  2477. .B 500-999
  2478. specifies the second 500 bytes
  2479. .TP
  2480. .B \-500
  2481. specifies the last 500 bytes
  2482. .TP
  2483. .B 9500-
  2484. specifies the bytes from offset 9500 and forward
  2485. .TP
  2486. .B 0-0,-1
  2487. specifies the first and last byte only(*)(HTTP)
  2488. .TP
  2489. .B 100-199,500-599
  2490. specifies two separate 100-byte ranges(*) (HTTP)
  2491. .RE
  2492. .IP
  2493. (*) = NOTE that this will cause the server to reply with a multipart
  2494. response, which will be returned as-is by curl! Parsing or otherwise
  2495. transforming this response is the responsibility of the caller.
  2496. Only digit characters (0-9) are valid in the \(aqstart' and 'stop' fields of the
  2497. \&\(aqstart-stop' range syntax. If a non-digit character is given in the range,
  2498. the server\(aqs response will be unspecified, depending on the server's
  2499. configuration.
  2500. You should also be aware that many HTTP/1.1 servers do not have this feature
  2501. enabled, so that when you attempt to get a range, you will instead get the
  2502. whole document.
  2503. FTP and SFTP range downloads only support the simple \(aqstart-stop' syntax
  2504. (optionally with one of the numbers omitted). FTP use depends on the extended
  2505. FTP command SIZE.
  2506. If this option is used several times, the last one will be used.
  2507. Example:
  2508. .nf
  2509. curl --range 22-44 https://example.com
  2510. .fi
  2511. .IP "\-\-raw"
  2512. (HTTP) When used, it disables all internal HTTP decoding of content or transfer
  2513. encodings and instead makes them passed on unaltered, raw.
  2514. Example:
  2515. .nf
  2516. curl --raw https://example.com
  2517. .fi
  2518. .IP "\-e, \-\-referer <URL>"
  2519. (HTTP) Sends the "Referrer Page" information to the HTTP server. This can also be set
  2520. with the \fI\-H, \-\-header\fP flag of course. When used with \fI\-L, \-\-location\fP you can append
  2521. ";auto" to the \fI\-e, \-\-referer\fP URL to make curl automatically set the previous URL
  2522. when it follows a Location: header. The \&";auto" string can be used alone,
  2523. even if you do not set an initial \fI\-e, \-\-referer\fP.
  2524. If this option is used several times, the last one will be used.
  2525. Examples:
  2526. .nf
  2527. curl --referer "https://fake.example" https://example.com
  2528. curl --referer "https://fake.example;auto" -L https://example.com
  2529. curl --referer ";auto" -L https://example.com
  2530. .fi
  2531. See also \fI-A, --user-agent\fP and \fI-H, --header\fP.
  2532. .IP "\-J, \-\-remote-header-name"
  2533. (HTTP) This option tells the \fI\-O, \-\-remote-name\fP option to use the server-specified
  2534. Content-Disposition filename instead of extracting a filename from the URL.
  2535. If the server specifies a file name and a file with that name already exists
  2536. in the current working directory it will not be overwritten and an error will
  2537. occur. If the server does not specify a file name then this option has no
  2538. effect.
  2539. There\(aqs no attempt to decode %-sequences (yet) in the provided file name, so
  2540. this option may provide you with rather unexpected file names.
  2541. \fBWARNING\fP: Exercise judicious use of this option, especially on Windows. A
  2542. rogue server could send you the name of a DLL or other file that could possibly
  2543. be loaded automatically by Windows or some third party software.
  2544. Example:
  2545. .nf
  2546. curl -OJ https://example.com/file
  2547. .fi
  2548. .IP "\-\-remote-name-all"
  2549. This option changes the default action for all given URLs to be dealt with as
  2550. if \fI\-O, \-\-remote-name\fP were used for each one. So if you want to disable that for a
  2551. specific URL after \fI\-\-remote-name-all\fP has been used, you must use "-o \-" or
  2552. \-\-no-remote-name.
  2553. Example:
  2554. .nf
  2555. curl --remote-name-all ftp://example.com/file1 ftp://example.com/file2
  2556. .fi
  2557. .IP "\-O, \-\-remote-name"
  2558. Write output to a local file named like the remote file we get. (Only the file
  2559. part of the remote file is used, the path is cut off.)
  2560. The file will be saved in the current working directory. If you want the file
  2561. saved in a different directory, make sure you change the current working
  2562. directory before invoking curl with this option.
  2563. The remote file name to use for saving is extracted from the given URL,
  2564. nothing else, and if it already exists it will be overwritten. If you want the
  2565. server to be able to choose the file name refer to \fI\-J, \-\-remote-header-name\fP which
  2566. can be used in addition to this option. If the server chooses a file name and
  2567. that name already exists it will not be overwritten.
  2568. There is no URL decoding done on the file name. If it has %20 or other URL
  2569. encoded parts of the name, they will end up as-is as file name.
  2570. You may use this option as many times as the number of URLs you have.
  2571. Example:
  2572. .nf
  2573. curl -O https://example.com/filename
  2574. .fi
  2575. .IP "\-R, \-\-remote-time"
  2576. When used, this will make curl attempt to figure out the timestamp of the
  2577. remote file, and if that is available make the local file get that same
  2578. timestamp.
  2579. Example:
  2580. .nf
  2581. curl --remote-time -o foo https://example.com
  2582. .fi
  2583. .IP "\-\-request-target <path>"
  2584. (HTTP) Tells curl to use an alternative "target" (path) instead of using the path as
  2585. provided in the URL. Particularly useful when wanting to issue HTTP requests
  2586. without leading slash or other data that does not follow the regular URL
  2587. pattern, like "OPTIONS *".
  2588. Example:
  2589. .nf
  2590. curl --request-target "*" -X OPTIONS https://example.com
  2591. .fi
  2592. Added in 7.55.0.
  2593. .IP "\-X, \-\-request <command>"
  2594. (HTTP) Specifies a custom request method to use when communicating with the
  2595. HTTP server. The specified request method will be used instead of the method
  2596. otherwise used (which defaults to GET). Read the HTTP 1.1 specification for
  2597. details and explanations. Common additional HTTP requests include PUT and
  2598. DELETE, but related technologies like WebDAV offers PROPFIND, COPY, MOVE and
  2599. more.
  2600. Normally you do not need this option. All sorts of GET, HEAD, POST and PUT
  2601. requests are rather invoked by using dedicated command line options.
  2602. This option only changes the actual word used in the HTTP request, it does not
  2603. alter the way curl behaves. So for example if you want to make a proper HEAD
  2604. request, using \-X HEAD will not suffice. You need to use the \fI\-I, \-\-head\fP option.
  2605. The method string you set with \fI\-X, \-\-request\fP will be used for all requests, which
  2606. if you for example use \fI\-L, \-\-location\fP may cause unintended side-effects when curl
  2607. does not change request method according to the HTTP 30x response codes \- and
  2608. similar.
  2609. (FTP)
  2610. Specifies a custom FTP command to use instead of LIST when doing file lists
  2611. with FTP.
  2612. (POP3)
  2613. Specifies a custom POP3 command to use instead of LIST or RETR.
  2614. (IMAP)
  2615. Specifies a custom IMAP command to use instead of LIST. (Added in 7.30.0)
  2616. (SMTP)
  2617. Specifies a custom SMTP command to use instead of HELP or VRFY. (Added in 7.34.0)
  2618. If this option is used several times, the last one will be used.
  2619. Examples:
  2620. .nf
  2621. curl -X "DELETE" https://example.com
  2622. curl -X NLST ftp://example.com/
  2623. .fi
  2624. .IP "\-\-resolve <[+]host:port:addr[,addr]...>"
  2625. Provide a custom address for a specific host and port pair. Using this, you
  2626. can make the curl requests(s) use a specified address and prevent the
  2627. otherwise normally resolved address to be used. Consider it a sort of
  2628. /etc/hosts alternative provided on the command line. The port number should be
  2629. the number used for the specific protocol the host will be used for. It means
  2630. you need several entries if you want to provide address for the same host but
  2631. different ports.
  2632. By specifying \(aq*' as host you can tell curl to resolve any host and specific
  2633. port pair to the specified address. Wildcard is resolved last so any \fI\-\-resolve\fP
  2634. with a specific host and port will be used first.
  2635. The provided address set by this option will be used even if \fI\-4, \-\-ipv4\fP or \fI\-6, \-\-ipv6\fP
  2636. is set to make curl use another IP version.
  2637. By prefixing the host with a \(aq+' you can make the entry time out after curl's
  2638. default timeout (1 minute). Note that this will only make sense for long
  2639. running parallel transfers with a lot of files. In such cases, if this option
  2640. is used curl will try to resolve the host as it normally would once the
  2641. timeout has expired.
  2642. Support for providing the IP address within [brackets] was added in 7.57.0.
  2643. Support for providing multiple IP addresses per entry was added in 7.59.0.
  2644. Support for resolving with wildcard was added in 7.64.0.
  2645. Support for the \(aq+' prefix was was added in 7.75.0.
  2646. This option can be used many times to add many host names to resolve.
  2647. Example:
  2648. .nf
  2649. curl --resolve example.com:443:127.0.0.1 https://example.com
  2650. .fi
  2651. .IP "\-\-retry-all-errors"
  2652. Retry on any error. This option is used together with \fI\-\-retry\fP.
  2653. This option is the "sledgehammer" of retrying. Do not use this option by
  2654. default (eg in curlrc), there may be unintended consequences such as sending or
  2655. receiving duplicate data. Do not use with redirected input or output. You\(aqd be
  2656. much better off handling your unique problems in shell script. Please read the
  2657. example below.
  2658. \fBWARNING\fP: For server compatibility curl attempts to retry failed flaky
  2659. transfers as close as possible to how they were started, but this is not
  2660. possible with redirected input or output. For example, before retrying it
  2661. removes output data from a failed partial transfer that was written to an
  2662. output file. However this is not true of data redirected to a | pipe or >
  2663. file, which are not reset. We strongly suggest you do not parse or record
  2664. output via redirect in combination with this option, since you may receive
  2665. duplicate data.
  2666. By default curl will not error on an HTTP response code that indicates an HTTP
  2667. error, if the transfer was successful. For example, if a server replies 404
  2668. Not Found and the reply is fully received then that is not an error. When
  2669. \fI\-\-retry\fP is used then curl will retry on some HTTP response codes that indicate
  2670. transient HTTP errors, but that does not include most 4xx response codes such
  2671. as 404. If you want to retry on all response codes that indicate HTTP errors
  2672. (4xx and 5xx) then combine with \fI\-f, \-\-fail\fP.
  2673. Example:
  2674. .nf
  2675. curl --retry-all-errors https://example.com
  2676. .fi
  2677. Added in 7.71.0.
  2678. .IP "\-\-retry-connrefused"
  2679. In addition to the other conditions, consider ECONNREFUSED as a transient
  2680. error too for \fI\-\-retry\fP. This option is used together with \-\-retry.
  2681. Example:
  2682. .nf
  2683. curl --retry-connrefused --retry https://example.com
  2684. .fi
  2685. Added in 7.52.0.
  2686. .IP "\-\-retry-delay <seconds>"
  2687. Make curl sleep this amount of time before each retry when a transfer has
  2688. failed with a transient error (it changes the default backoff time algorithm
  2689. between retries). This option is only interesting if \fI\-\-retry\fP is also
  2690. used. Setting this delay to zero will make curl use the default backoff time.
  2691. If this option is used several times, the last one will be used.
  2692. Example:
  2693. .nf
  2694. curl --retry-delay 5 --retry https://example.com
  2695. .fi
  2696. .IP "\-\-retry-max-time <seconds>"
  2697. The retry timer is reset before the first transfer attempt. Retries will be
  2698. done as usual (see \fI\-\-retry\fP) as long as the timer has not reached this given
  2699. limit. Notice that if the timer has not reached the limit, the request will be
  2700. made and while performing, it may take longer than this given time period. To
  2701. limit a single request\(aqs maximum time, use \fI\-m, \-\-max-time\fP. Set this option to
  2702. zero to not timeout retries.
  2703. If this option is used several times, the last one will be used.
  2704. Example:
  2705. .nf
  2706. curl --retry-max-time 30 --retry 10 https://example.com
  2707. .fi
  2708. .IP "\-\-retry <num>"
  2709. If a transient error is returned when curl tries to perform a transfer, it
  2710. will retry this number of times before giving up. Setting the number to 0
  2711. makes curl do no retries (which is the default). Transient error means either:
  2712. a timeout, an FTP 4xx response code or an HTTP 408, 429, 500, 502, 503 or 504
  2713. response code.
  2714. When curl is about to retry a transfer, it will first wait one second and then
  2715. for all forthcoming retries it will double the waiting time until it reaches
  2716. 10 minutes which then will be the delay between the rest of the retries. By
  2717. using \fI\-\-retry-delay\fP you disable this exponential backoff algorithm. See also
  2718. \fI\-\-retry-max-time\fP to limit the total time allowed for retries.
  2719. Since curl 7.66.0, curl will comply with the Retry-After: response header if
  2720. one was present to know when to issue the next retry.
  2721. If this option is used several times, the last one will be used.
  2722. Example:
  2723. .nf
  2724. curl --retry 7 https://example.com
  2725. .fi
  2726. .IP "\-\-sasl-authzid <identity>"
  2727. Use this authorisation identity (authzid), during SASL PLAIN authentication,
  2728. in addition to the authentication identity (authcid) as specified by \fI\-u, \-\-user\fP.
  2729. If the option is not specified, the server will derive the authzid from the
  2730. authcid, but if specified, and depending on the server implementation, it may
  2731. be used to access another user\(aqs inbox, that the user has been granted access
  2732. to, or a shared mailbox for example.
  2733. Example:
  2734. .nf
  2735. curl --sasl-authzid zid imap://example.com/
  2736. .fi
  2737. Added in 7.66.0.
  2738. .IP "\-\-sasl-ir"
  2739. Enable initial response in SASL authentication.
  2740. Example:
  2741. .nf
  2742. curl --sasl-ir imap://example.com/
  2743. .fi
  2744. Added in 7.31.0.
  2745. .IP "\-\-service-name <name>"
  2746. This option allows you to change the service name for SPNEGO.
  2747. Examples: \fI\-\-negotiate\fP \fI\-\-service-name\fP sockd would use sockd/server-name.
  2748. Example:
  2749. .nf
  2750. curl --service-name sockd/server https://example.com
  2751. .fi
  2752. Added in 7.43.0.
  2753. .IP "\-S, \-\-show-error"
  2754. When used with \fI\-s, \-\-silent\fP, it makes curl show an error message if it fails.
  2755. This option is global and does not need to be specified for each use of
  2756. \fI\-:, \-\-next\fP.
  2757. Example:
  2758. .nf
  2759. curl --show-error --silent https://example.com
  2760. .fi
  2761. See also \fI--no-progress-meter\fP.
  2762. .IP "\-s, \-\-silent"
  2763. Silent or quiet mode. Do not show progress meter or error messages. Makes Curl
  2764. mute. It will still output the data you ask for, potentially even to the
  2765. terminal/stdout unless you redirect it.
  2766. Use \fI\-S, \-\-show-error\fP in addition to this option to disable progress meter but
  2767. still show error messages.
  2768. Example:
  2769. .nf
  2770. curl -s https://example.com
  2771. .fi
  2772. See also \fI-v, --verbose\fP, \fI--stderr\fP and \fI--no-progress-meter\fP.
  2773. .IP "\-\-socks4 <host[:port]>"
  2774. Use the specified SOCKS4 proxy. If the port number is not specified, it is
  2775. assumed at port 1080. Using this socket type make curl resolve the host name
  2776. and passing the address on to the proxy.
  2777. This option overrides any previous use of \fI\-x, \-\-proxy\fP, as they are mutually
  2778. exclusive.
  2779. This option is superfluous since you can specify a socks4 proxy with \fI\-x, \-\-proxy\fP
  2780. using a socks4:// protocol prefix.
  2781. Since 7.52.0, \fI\-\-preproxy\fP can be used to specify a SOCKS proxy at the same time
  2782. \fI\-x, \-\-proxy\fP is used with an HTTP/HTTPS proxy. In such a case curl first connects to
  2783. the SOCKS proxy and then connects (through SOCKS) to the HTTP or HTTPS proxy.
  2784. If this option is used several times, the last one will be used.
  2785. Example:
  2786. .nf
  2787. curl --socks4 hostname:4096 https://example.com
  2788. .fi
  2789. .IP "\-\-socks4a <host[:port]>"
  2790. Use the specified SOCKS4a proxy. If the port number is not specified, it is
  2791. assumed at port 1080. This asks the proxy to resolve the host name.
  2792. This option overrides any previous use of \fI\-x, \-\-proxy\fP, as they are mutually
  2793. exclusive.
  2794. This option is superfluous since you can specify a socks4a proxy with \fI\-x, \-\-proxy\fP
  2795. using a socks4a:// protocol prefix.
  2796. Since 7.52.0, \fI\-\-preproxy\fP can be used to specify a SOCKS proxy at the same time
  2797. \fI\-x, \-\-proxy\fP is used with an HTTP/HTTPS proxy. In such a case curl first connects to
  2798. the SOCKS proxy and then connects (through SOCKS) to the HTTP or HTTPS proxy.
  2799. If this option is used several times, the last one will be used.
  2800. Example:
  2801. .nf
  2802. curl --socks4a hostname:4096 https://example.com
  2803. .fi
  2804. .IP "\-\-socks5-basic"
  2805. Tells curl to use username/password authentication when connecting to a SOCKS5
  2806. proxy. The username/password authentication is enabled by default. Use
  2807. \fI\-\-socks5-gssapi\fP to force GSS-API authentication to SOCKS5 proxies.
  2808. Example:
  2809. .nf
  2810. curl --socks5-basic --socks5 hostname:4096 https://example.com
  2811. .fi
  2812. Added in 7.55.0.
  2813. .IP "\-\-socks5-gssapi-nec"
  2814. As part of the GSS-API negotiation a protection mode is negotiated. RFC 1961
  2815. says in section 4.3/4.4 it should be protected, but the NEC reference
  2816. implementation does not. The option \fI\-\-socks5-gssapi-nec\fP allows the
  2817. unprotected exchange of the protection mode negotiation.
  2818. Example:
  2819. .nf
  2820. curl --socks5-gssapi-nec --socks5 hostname:4096 https://example.com
  2821. .fi
  2822. .IP "\-\-socks5-gssapi-service <name>"
  2823. The default service name for a socks server is rcmd/server-fqdn. This option
  2824. allows you to change it.
  2825. Examples: \fI\-\-socks5\fP proxy-name \fI\-\-socks5-gssapi-service\fP sockd would use
  2826. sockd/proxy-name \fI\-\-socks5\fP proxy-name \fI\-\-socks5-gssapi-service\fP sockd/real-name
  2827. would use sockd/real-name for cases where the proxy-name does not match the
  2828. principal name.
  2829. Example:
  2830. .nf
  2831. curl --socks5-gssapi-service sockd --socks5 hostname:4096 https://example.com
  2832. .fi
  2833. .IP "\-\-socks5-gssapi"
  2834. Tells curl to use GSS-API authentication when connecting to a SOCKS5 proxy.
  2835. The GSS-API authentication is enabled by default (if curl is compiled with
  2836. GSS-API support). Use \fI\-\-socks5-basic\fP to force username/password authentication
  2837. to SOCKS5 proxies.
  2838. Example:
  2839. .nf
  2840. curl --socks5-gssapi --socks5 hostname:4096 https://example.com
  2841. .fi
  2842. Added in 7.55.0.
  2843. .IP "\-\-socks5-hostname <host[:port]>"
  2844. Use the specified SOCKS5 proxy (and let the proxy resolve the host name). If
  2845. the port number is not specified, it is assumed at port 1080.
  2846. This option overrides any previous use of \fI\-x, \-\-proxy\fP, as they are mutually
  2847. exclusive.
  2848. This option is superfluous since you can specify a socks5 hostname proxy with
  2849. \fI\-x, \-\-proxy\fP using a socks5h:// protocol prefix.
  2850. Since 7.52.0, \fI\-\-preproxy\fP can be used to specify a SOCKS proxy at the same time
  2851. \fI\-x, \-\-proxy\fP is used with an HTTP/HTTPS proxy. In such a case curl first connects to
  2852. the SOCKS proxy and then connects (through SOCKS) to the HTTP or HTTPS proxy.
  2853. If this option is used several times, the last one will be used.
  2854. Example:
  2855. .nf
  2856. curl --socks5-hostname proxy.example:7000 https://example.com
  2857. .fi
  2858. .IP "\-\-socks5 <host[:port]>"
  2859. Use the specified SOCKS5 proxy \- but resolve the host name locally. If the
  2860. port number is not specified, it is assumed at port 1080.
  2861. This option overrides any previous use of \fI\-x, \-\-proxy\fP, as they are mutually
  2862. exclusive.
  2863. This option is superfluous since you can specify a socks5 proxy with \fI\-x, \-\-proxy\fP
  2864. using a socks5:// protocol prefix.
  2865. Since 7.52.0, \fI\-\-preproxy\fP can be used to specify a SOCKS proxy at the same time
  2866. \fI\-x, \-\-proxy\fP is used with an HTTP/HTTPS proxy. In such a case curl first connects to
  2867. the SOCKS proxy and then connects (through SOCKS) to the HTTP or HTTPS proxy.
  2868. If this option is used several times, the last one will be used.
  2869. This option (as well as \fI\-\-socks4\fP) does not work with IPV6, FTPS or LDAP.
  2870. Example:
  2871. .nf
  2872. curl --socks5 proxy.example:7000 https://example.com
  2873. .fi
  2874. .IP "\-Y, \-\-speed-limit <speed>"
  2875. If a download is slower than this given speed (in bytes per second) for
  2876. speed-time seconds it gets aborted. speed-time is set with \fI\-y, \-\-speed-time\fP and is
  2877. 30 if not set.
  2878. If this option is used several times, the last one will be used.
  2879. Example:
  2880. .nf
  2881. curl --speed-limit 300 --speed-time 10 https://example.com
  2882. .fi
  2883. .IP "\-y, \-\-speed-time <seconds>"
  2884. If a download is slower than speed-limit bytes per second during a speed-time
  2885. period, the download gets aborted. If speed-time is used, the default
  2886. speed-limit will be 1 unless set with \fI\-Y, \-\-speed-limit\fP.
  2887. This option controls transfers and thus will not affect slow connects etc. If
  2888. this is a concern for you, try the \fI\-\-connect-timeout\fP option.
  2889. If this option is used several times, the last one will be used.
  2890. Example:
  2891. .nf
  2892. curl --speed-limit 300 --speed-time 10 https://example.com
  2893. .fi
  2894. .IP "\-\-ssl-allow-beast"
  2895. This option tells curl to not work around a security flaw in the SSL3 and
  2896. TLS1.0 protocols known as BEAST. If this option is not used, the SSL layer
  2897. may use workarounds known to cause interoperability problems with some older
  2898. SSL implementations.
  2899. \fBWARNING\fP: this option loosens the SSL security, and by using this flag you
  2900. ask for exactly that.
  2901. Example:
  2902. .nf
  2903. curl --ssl-allow-beast https://example.com
  2904. .fi
  2905. .IP "\-\-ssl-auto-client-cert"
  2906. Tell libcurl to automatically locate and use a client certificate for
  2907. authentication, when requested by the server. This option is only supported
  2908. for Schannel (the native Windows SSL library). Prior to 7.77.0 this was the
  2909. default behavior in libcurl with Schannel. Since the server can request any
  2910. certificate that supports client authentication in the OS certificate store it
  2911. could be a privacy violation and unexpected.
  2912. Example:
  2913. .nf
  2914. curl --ssl-auto-client-cert https://example.com
  2915. .fi
  2916. See also \fI--proxy-ssl-auto-client-cert\fP. Added in 7.77.0.
  2917. .IP "\-\-ssl-no-revoke"
  2918. (Schannel) This option tells curl to disable certificate revocation checks.
  2919. WARNING: this option loosens the SSL security, and by using this flag you ask
  2920. for exactly that.
  2921. Example:
  2922. .nf
  2923. curl --ssl-no-revoke https://example.com
  2924. .fi
  2925. Added in 7.44.0.
  2926. .IP "\-\-ssl-reqd"
  2927. (FTP IMAP POP3 SMTP) Require SSL/TLS for the connection. Terminates the connection if the server
  2928. does not support SSL/TLS.
  2929. This option was formerly known as \-\-ftp-ssl-reqd.
  2930. Example:
  2931. .nf
  2932. curl --ssl-reqd ftp://example.com
  2933. .fi
  2934. .IP "\-\-ssl-revoke-best-effort"
  2935. (Schannel) This option tells curl to ignore certificate revocation checks when
  2936. they failed due to missing/offline distribution points for the revocation check
  2937. lists.
  2938. Example:
  2939. .nf
  2940. curl --ssl-revoke-best-effort https://example.com
  2941. .fi
  2942. Added in 7.70.0.
  2943. .IP "\-\-ssl"
  2944. (FTP IMAP POP3 SMTP) Try to use SSL/TLS for the connection. Reverts to a non-secure connection if
  2945. the server does not support SSL/TLS. See also \fI\-\-ftp-ssl-control\fP and \fI\-\-ssl-reqd\fP
  2946. for different levels of encryption required.
  2947. This option was formerly known as \-\-ftp-ssl. That option
  2948. name can still be used but will be removed in a future version.
  2949. Example:
  2950. .nf
  2951. curl --ssl pop3://example.com/
  2952. .fi
  2953. .IP "\-2, \-\-sslv2"
  2954. (SSL) This option previously asked curl to use SSLv2, but starting in curl 7.77.0
  2955. this instruction is ignored. SSLv2 is widely considered insecure (see RFC
  2956. 6176).
  2957. Example:
  2958. .nf
  2959. curl --sslv2 https://example.com
  2960. .fi
  2961. See also \fI--http1.1\fP and \fI--http2\fP. \fI-2, --sslv2\fP requires that the underlying libcurl was built to support TLS. This option overrides \fI-3, --sslv3\fP and \fI-1, --tlsv1\fP and \fI--tlsv1.1\fP and \fI--tlsv1.2\fP.
  2962. .IP "\-3, \-\-sslv3"
  2963. (SSL) This option previously asked curl to use SSLv3, but starting in curl 7.77.0
  2964. this instruction is ignored. SSLv3 is widely considered insecure (see RFC
  2965. 7568).
  2966. Example:
  2967. .nf
  2968. curl --sslv3 https://example.com
  2969. .fi
  2970. See also \fI--http1.1\fP and \fI--http2\fP. \fI-3, --sslv3\fP requires that the underlying libcurl was built to support TLS. This option overrides \fI-2, --sslv2\fP and \fI-1, --tlsv1\fP and \fI--tlsv1.1\fP and \fI--tlsv1.2\fP.
  2971. .IP "\-\-stderr <file>"
  2972. Redirect all writes to stderr to the specified file instead. If the file name
  2973. is a plain \(aq-', it is instead written to stdout.
  2974. This option is global and does not need to be specified for each use of
  2975. \fI\-:, \-\-next\fP.
  2976. If this option is used several times, the last one will be used.
  2977. Example:
  2978. .nf
  2979. curl --stderr output.txt https://example.com
  2980. .fi
  2981. See also \fI-v, --verbose\fP and \fI-s, --silent\fP.
  2982. .IP "\-\-styled-output"
  2983. Enables the automatic use of bold font styles when writing HTTP headers to the
  2984. terminal. Use \-\-no-styled-output to switch them off.
  2985. This option is global and does not need to be specified for each use of
  2986. \fI\-:, \-\-next\fP.
  2987. Example:
  2988. .nf
  2989. curl --styled-output -I https://example.com
  2990. .fi
  2991. Added in 7.61.0.
  2992. .IP "\-\-suppress-connect-headers"
  2993. When \fI\-p, \-\-proxytunnel\fP is used and a CONNECT request is made do not output proxy
  2994. CONNECT response headers. This option is meant to be used with \fI\-D, \-\-dump-header\fP or
  2995. \fI\-i, \-\-include\fP which are used to show protocol headers in the output. It has no
  2996. effect on debug options such as \fI\-v, \-\-verbose\fP or \fI\-\-trace\fP, or any statistics.
  2997. Example:
  2998. .nf
  2999. curl --suppress-connect-headers --include -x proxy https://example.com
  3000. .fi
  3001. See also \fI-D, --dump-header\fP, \fI-i, --include\fP and \fI-p, --proxytunnel\fP. Added in 7.54.0.
  3002. .IP "\-\-tcp-fastopen"
  3003. Enable use of TCP Fast Open (RFC7413).
  3004. Example:
  3005. .nf
  3006. curl --tcp-fastopen https://example.com
  3007. .fi
  3008. Added in 7.49.0.
  3009. .IP "\-\-tcp-nodelay"
  3010. Turn on the TCP_NODELAY option. See the \fIcurl_easy_setopt(3)\fP man page for
  3011. details about this option.
  3012. Since 7.50.2, curl sets this option by default and you need to explicitly
  3013. switch it off if you do not want it on.
  3014. Example:
  3015. .nf
  3016. curl --tcp-nodelay https://example.com
  3017. .fi
  3018. .IP "\-t, \-\-telnet-option <opt=val>"
  3019. Pass options to the telnet protocol. Supported options are:
  3020. TTYPE=<term> Sets the terminal type.
  3021. XDISPLOC=<X display> Sets the X display location.
  3022. NEW_ENV=<var,val> Sets an environment variable.
  3023. Example:
  3024. .nf
  3025. curl -t TTYPE=vt100 telnet://example.com/
  3026. .fi
  3027. .IP "\-\-tftp-blksize <value>"
  3028. (TFTP) Set TFTP BLKSIZE option (must be >512). This is the block size that curl will
  3029. try to use when transferring data to or from a TFTP server. By default 512
  3030. bytes will be used.
  3031. If this option is used several times, the last one will be used.
  3032. Example:
  3033. .nf
  3034. curl --tftp-blksize 1024 tftp://example.com/file
  3035. .fi
  3036. .IP "\-\-tftp-no-options"
  3037. (TFTP) Tells curl not to send TFTP options requests.
  3038. This option improves interop with some legacy servers that do not acknowledge
  3039. or properly implement TFTP options. When this option is used \fI\-\-tftp-blksize\fP is
  3040. ignored.
  3041. Example:
  3042. .nf
  3043. curl --tftp-no-options tftp://192.168.0.1/
  3044. .fi
  3045. Added in 7.48.0.
  3046. .IP "\-z, \-\-time-cond <time>"
  3047. (HTTP FTP) Request a file that has been modified later than the given time and date, or
  3048. one that has been modified before that time. The <date expression> can be all
  3049. sorts of date strings or if it does not match any internal ones, it is taken as
  3050. a filename and tries to get the modification date (mtime) from <file>
  3051. instead. See the \fIcurl_getdate(3)\fP man pages for date expression details.
  3052. Start the date expression with a dash (-) to make it request for a document
  3053. that is older than the given date/time, default is a document that is newer
  3054. than the specified date/time.
  3055. If this option is used several times, the last one will be used.
  3056. Examples:
  3057. .nf
  3058. curl -z "Wed 01 Sep 2021 12:18:00" https://example.com
  3059. curl -z "-Wed 01 Sep 2021 12:18:00" https://example.com
  3060. curl -z file https://example.com
  3061. .fi
  3062. .IP "\-\-tls-max <VERSION>"
  3063. (SSL) VERSION defines maximum supported TLS version. The minimum acceptable version
  3064. is set by tlsv1.0, tlsv1.1, tlsv1.2 or tlsv1.3.
  3065. If the connection is done without TLS, this option has no effect. This
  3066. includes QUIC-using (HTTP/3) transfers.
  3067. .RS
  3068. .IP "default"
  3069. Use up to recommended TLS version.
  3070. .IP "1.0"
  3071. Use up to TLSv1.0.
  3072. .IP "1.1"
  3073. Use up to TLSv1.1.
  3074. .IP "1.2"
  3075. Use up to TLSv1.2.
  3076. .IP "1.3"
  3077. Use up to TLSv1.3.
  3078. .RE
  3079. Examples:
  3080. .nf
  3081. curl --tls-max 1.2 https://example.com
  3082. curl --tls-max 1.3 --tlsv1.2 https://example.com
  3083. .fi
  3084. See also \fI--tlsv1.0\fP, \fI--tlsv1.1\fP, \fI--tlsv1.2\fP and \fI--tlsv1.3\fP. \fI--tls-max\fP requires that the underlying libcurl was built to support TLS. Added in 7.54.0.
  3085. .IP "\-\-tls13-ciphers <ciphersuite list>"
  3086. (TLS) Specifies which cipher suites to use in the connection if it negotiates TLS
  3087. 1.3. The list of ciphers suites must specify valid ciphers. Read up on TLS 1.3
  3088. cipher suite details on this URL:
  3089. https://curl.se/docs/ssl-ciphers.html
  3090. This option is currently used only when curl is built to use OpenSSL 1.1.1 or
  3091. later. If you are using a different SSL backend you can try setting TLS 1.3
  3092. cipher suites by using the \fI\-\-ciphers\fP option.
  3093. If this option is used several times, the last one will be used.
  3094. Example:
  3095. .nf
  3096. curl --tls13-ciphers TLS_AES_128_GCM_SHA256 https://example.com
  3097. .fi
  3098. Added in 7.61.0.
  3099. .IP "\-\-tlsauthtype <type>"
  3100. Set TLS authentication type. Currently, the only supported option is "SRP",
  3101. for TLS-SRP (RFC 5054). If \fI\-\-tlsuser\fP and \fI\-\-tlspassword\fP are specified but
  3102. \fI\-\-tlsauthtype\fP is not, then this option defaults to "SRP". This option works
  3103. only if the underlying libcurl is built with TLS-SRP support, which requires
  3104. OpenSSL or GnuTLS with TLS-SRP support.
  3105. Example:
  3106. .nf
  3107. curl --tlsauthtype SRP https://example.com
  3108. .fi
  3109. .IP "\-\-tlspassword <string>"
  3110. Set password for use with the TLS authentication method specified with
  3111. \fI\-\-tlsauthtype\fP. Requires that \fI\-\-tlsuser\fP also be set.
  3112. This option does not work with TLS 1.3.
  3113. Example:
  3114. .nf
  3115. curl --tlspassword pwd --tlsuser user https://example.com
  3116. .fi
  3117. .IP "\-\-tlsuser <name>"
  3118. Set username for use with the TLS authentication method specified with
  3119. \fI\-\-tlsauthtype\fP. Requires that \fI\-\-tlspassword\fP also is set.
  3120. This option does not work with TLS 1.3.
  3121. Example:
  3122. .nf
  3123. curl --tlspassword pwd --tlsuser user https://example.com
  3124. .fi
  3125. .IP "\-\-tlsv1.0"
  3126. (TLS) Forces curl to use TLS version 1.0 or later when connecting to a remote TLS server.
  3127. In old versions of curl this option was documented to allow _only_ TLS 1.0,
  3128. but behavior was inconsistent depending on the TLS library. Use \fI\-\-tls-max\fP if
  3129. you want to set a maximum TLS version.
  3130. Example:
  3131. .nf
  3132. curl --tlsv1.0 https://example.com
  3133. .fi
  3134. Added in 7.34.0.
  3135. .IP "\-\-tlsv1.1"
  3136. (TLS) Forces curl to use TLS version 1.1 or later when connecting to a remote TLS server.
  3137. In old versions of curl this option was documented to allow _only_ TLS 1.1,
  3138. but behavior was inconsistent depending on the TLS library. Use \fI\-\-tls-max\fP if
  3139. you want to set a maximum TLS version.
  3140. Example:
  3141. .nf
  3142. curl --tlsv1.1 https://example.com
  3143. .fi
  3144. Added in 7.34.0.
  3145. .IP "\-\-tlsv1.2"
  3146. (TLS) Forces curl to use TLS version 1.2 or later when connecting to a remote TLS server.
  3147. In old versions of curl this option was documented to allow _only_ TLS 1.2,
  3148. but behavior was inconsistent depending on the TLS library. Use \fI\-\-tls-max\fP if
  3149. you want to set a maximum TLS version.
  3150. Example:
  3151. .nf
  3152. curl --tlsv1.2 https://example.com
  3153. .fi
  3154. Added in 7.34.0.
  3155. .IP "\-\-tlsv1.3"
  3156. (TLS) Forces curl to use TLS version 1.3 or later when connecting to a remote TLS
  3157. server.
  3158. If the connection is done without TLS, this option has no effect. This
  3159. includes QUIC-using (HTTP/3) transfers.
  3160. Note that TLS 1.3 is not supported by all TLS backends.
  3161. Example:
  3162. .nf
  3163. curl --tlsv1.3 https://example.com
  3164. .fi
  3165. Added in 7.52.0.
  3166. .IP "\-1, \-\-tlsv1"
  3167. (SSL) Tells curl to use at least TLS version 1.x when negotiating with a remote TLS
  3168. server. That means TLS version 1.0 or higher
  3169. Example:
  3170. .nf
  3171. curl --tlsv1 https://example.com
  3172. .fi
  3173. See also \fI--http1.1\fP and \fI--http2\fP. \fI-1, --tlsv1\fP requires that the underlying libcurl was built to support TLS. This option overrides \fI--tlsv1.1\fP and \fI--tlsv1.2\fP and \fI--tlsv1.3\fP.
  3174. .IP "\-\-tr-encoding"
  3175. (HTTP) Request a compressed Transfer-Encoding response using one of the algorithms
  3176. curl supports, and uncompress the data while receiving it.
  3177. Example:
  3178. .nf
  3179. curl --tr-encoding https://example.com
  3180. .fi
  3181. .IP "\-\-trace-ascii <file>"
  3182. Enables a full trace dump of all incoming and outgoing data, including
  3183. descriptive information, to the given output file. Use "-" as filename to have
  3184. the output sent to stdout.
  3185. This is similar to \fI\-\-trace\fP, but leaves out the hex part and only shows the
  3186. ASCII part of the dump. It makes smaller output that might be easier to read
  3187. for untrained humans.
  3188. This option is global and does not need to be specified for each use of
  3189. \fI\-:, \-\-next\fP.
  3190. If this option is used several times, the last one will be used.
  3191. Example:
  3192. .nf
  3193. curl --trace-ascii log.txt https://example.com
  3194. .fi
  3195. This option overrides \fI--trace\fP and \fI-v, --verbose\fP.
  3196. .IP "\-\-trace-time"
  3197. Prepends a time stamp to each trace or verbose line that curl displays.
  3198. This option is global and does not need to be specified for each use of
  3199. \fI\-:, \-\-next\fP.
  3200. Example:
  3201. .nf
  3202. curl --trace-time --trace-ascii output https://example.com
  3203. .fi
  3204. .IP "\-\-trace <file>"
  3205. Enables a full trace dump of all incoming and outgoing data, including
  3206. descriptive information, to the given output file. Use "-" as filename to have
  3207. the output sent to stdout. Use "%" as filename to have the output sent to
  3208. stderr.
  3209. This option is global and does not need to be specified for each use of
  3210. \fI\-:, \-\-next\fP.
  3211. If this option is used several times, the last one will be used.
  3212. Example:
  3213. .nf
  3214. curl --trace log.txt https://example.com
  3215. .fi
  3216. This option overrides \fI-v, --verbose\fP and \fI--trace-ascii\fP.
  3217. .IP "\-\-unix-socket <path>"
  3218. (HTTP) Connect through this Unix domain socket, instead of using the network.
  3219. Example:
  3220. .nf
  3221. curl --unix-socket socket-path https://example.com
  3222. .fi
  3223. Added in 7.40.0.
  3224. .IP "\-T, \-\-upload-file <file>"
  3225. This transfers the specified local file to the remote URL. If there is no file
  3226. part in the specified URL, curl will append the local file name. NOTE that you
  3227. must use a trailing / on the last directory to really prove to Curl that there
  3228. is no file name or curl will think that your last directory name is the remote
  3229. file name to use. That will most likely cause the upload operation to fail. If
  3230. this is used on an HTTP(S) server, the PUT command will be used.
  3231. Use the file name "-" (a single dash) to use stdin instead of a given file.
  3232. Alternately, the file name "." (a single period) may be specified instead of
  3233. "-" to use stdin in non-blocking mode to allow reading server output while
  3234. stdin is being uploaded.
  3235. You can specify one \fI\-T, \-\-upload-file\fP for each URL on the command line. Each
  3236. \fI\-T, \-\-upload-file\fP + URL pair specifies what to upload and to where. curl also
  3237. supports "globbing" of the \fI\-T, \-\-upload-file\fP argument, meaning that you can upload
  3238. multiple files to a single URL by using the same URL globbing style supported
  3239. in the URL.
  3240. When uploading to an SMTP server: the uploaded data is assumed to be RFC 5322
  3241. formatted. It has to feature the necessary set of headers and mail body
  3242. formatted correctly by the user as curl will not transcode nor encode it
  3243. further in any way.
  3244. Examples:
  3245. .nf
  3246. curl -T file https://example.com
  3247. curl -T "img[1-1000].png" ftp://ftp.example.com/
  3248. curl --upload-file "{file1,file2}" https://example.com
  3249. .fi
  3250. .IP "\-\-url <url>"
  3251. Specify a URL to fetch. This option is mostly handy when you want to specify
  3252. URL(s) in a config file.
  3253. If the given URL is missing a scheme name (such as "http://" or "ftp://" etc)
  3254. then curl will make a guess based on the host. If the outermost sub-domain
  3255. name matches DICT, FTP, IMAP, LDAP, POP3 or SMTP then that protocol will be
  3256. used, otherwise HTTP will be used. Since 7.45.0 guessing can be disabled by
  3257. setting a default protocol, see \fI\-\-proto-default\fP for details.
  3258. This option may be used any number of times. To control where this URL is
  3259. written, use the \fI\-o, \-\-output\fP or the \fI\-O, \-\-remote-name\fP options.
  3260. \fBWARNING\fP: On Windows, particular file:// accesses can be converted to
  3261. network accesses by the operating system. Beware!
  3262. Example:
  3263. .nf
  3264. curl --url https://example.com
  3265. .fi
  3266. .IP "\-B, \-\-use-ascii"
  3267. (FTP LDAP) Enable ASCII transfer. For FTP, this can also be enforced by using a URL that
  3268. ends with ";type=A". This option causes data sent to stdout to be in text mode
  3269. for win32 systems.
  3270. Example:
  3271. .nf
  3272. curl -B ftp://example.com/README
  3273. .fi
  3274. .IP "\-A, \-\-user-agent <name>"
  3275. (HTTP) Specify the User-Agent string to send to the HTTP server. To encode blanks in
  3276. the string, surround the string with single quote marks. This header can also
  3277. be set with the \fI\-H, \-\-header\fP or the \fI\-\-proxy-header\fP options.
  3278. If you give an empty argument to \fI\-A, \-\-user-agent\fP (""), it will remove the header
  3279. completely from the request. If you prefer a blank header, you can set it to a
  3280. single space (" ").
  3281. If this option is used several times, the last one will be used.
  3282. Example:
  3283. .nf
  3284. curl -A "Agent 007" https://example.com
  3285. .fi
  3286. .IP "\-u, \-\-user <user:password>"
  3287. Specify the user name and password to use for server authentication. Overrides
  3288. \fI\-n, \-\-netrc\fP and \fI\-\-netrc-optional\fP.
  3289. If you simply specify the user name, curl will prompt for a password.
  3290. The user name and passwords are split up on the first colon, which makes it
  3291. impossible to use a colon in the user name with this option. The password can,
  3292. still.
  3293. On systems where it works, curl will hide the given option argument from
  3294. process listings. This is not enough to protect credentials from possibly
  3295. getting seen by other users on the same system as they will still be visible
  3296. for a moment before cleared. Such sensitive data should be retrieved from a
  3297. file instead or similar and never used in clear text in a command line.
  3298. When using Kerberos V5 with a Windows based server you should include the
  3299. Windows domain name in the user name, in order for the server to successfully
  3300. obtain a Kerberos Ticket. If you do not, then the initial authentication
  3301. handshake may fail.
  3302. When using NTLM, the user name can be specified simply as the user name,
  3303. without the domain, if there is a single domain and forest in your setup
  3304. for example.
  3305. To specify the domain name use either Down-Level Logon Name or UPN (User
  3306. Principal Name) formats. For example, EXAMPLE\\user and [email protected]
  3307. respectively.
  3308. If you use a Windows SSPI-enabled curl binary and perform Kerberos V5,
  3309. Negotiate, NTLM or Digest authentication then you can tell curl to select
  3310. the user name and password from your environment by specifying a single colon
  3311. with this option: "-u :".
  3312. If this option is used several times, the last one will be used.
  3313. Example:
  3314. .nf
  3315. curl -u user:secret https://example.com
  3316. .fi
  3317. .IP "\-v, \-\-verbose"
  3318. Makes curl verbose during the operation. Useful for debugging and seeing
  3319. what\(aqs going on "under the hood". A line starting with '>' means "header data"
  3320. sent by curl, \(aq<' means "header data" received by curl that is hidden in
  3321. normal cases, and a line starting with \(aq*' means additional info provided by
  3322. curl.
  3323. If you only want HTTP headers in the output, \fI\-i, \-\-include\fP might be the option
  3324. you are looking for.
  3325. If you think this option still does not give you enough details, consider using
  3326. \fI\-\-trace\fP or \fI\-\-trace-ascii\fP instead.
  3327. This option is global and does not need to be specified for each use of
  3328. \fI\-:, \-\-next\fP.
  3329. Use \fI\-s, \-\-silent\fP to make curl really quiet.
  3330. Example:
  3331. .nf
  3332. curl --verbose https://example.com
  3333. .fi
  3334. See also \fI-i, --include\fP. This option overrides \fI--trace\fP and \fI--trace-ascii\fP.
  3335. .IP "\-V, \-\-version"
  3336. Displays information about curl and the libcurl version it uses.
  3337. The first line includes the full version of curl, libcurl and other 3rd party
  3338. libraries linked with the executable.
  3339. The second line (starts with "Protocols:") shows all protocols that libcurl
  3340. reports to support.
  3341. The third line (starts with "Features:") shows specific features libcurl
  3342. reports to offer. Available features include:
  3343. .RS
  3344. .IP "alt-svc"
  3345. Support for the Alt-Svc: header is provided.
  3346. .IP "AsynchDNS"
  3347. This curl uses asynchronous name resolves. Asynchronous name resolves can be
  3348. done using either the c-ares or the threaded resolver backends.
  3349. .IP "brotli"
  3350. Support for automatic brotli compression over HTTP(S).
  3351. .IP "CharConv"
  3352. curl was built with support for character set conversions (like EBCDIC)
  3353. .IP "Debug"
  3354. This curl uses a libcurl built with Debug. This enables more error-tracking
  3355. and memory debugging etc. For curl-developers only!
  3356. .IP "gsasl"
  3357. The built-in SASL authentication includes extensions to support SCRAM because
  3358. libcurl was built with libgsasl.
  3359. .IP "GSS-API"
  3360. GSS-API is supported.
  3361. .IP "HSTS"
  3362. HSTS support is present.
  3363. .IP "HTTP2"
  3364. HTTP/2 support has been built-in.
  3365. .IP "HTTP3"
  3366. HTTP/3 support has been built-in.
  3367. .IP "HTTPS-proxy"
  3368. This curl is built to support HTTPS proxy.
  3369. .IP "IDN"
  3370. This curl supports IDN \- international domain names.
  3371. .IP "IPv6"
  3372. You can use IPv6 with this.
  3373. .IP "Kerberos"
  3374. Kerberos V5 authentication is supported.
  3375. .IP "Largefile"
  3376. This curl supports transfers of large files, files larger than 2GB.
  3377. .IP "libz"
  3378. Automatic decompression (via gzip, deflate) of compressed files over HTTP is
  3379. supported.
  3380. .IP "MultiSSL"
  3381. This curl supports multiple TLS backends.
  3382. .IP "NTLM"
  3383. NTLM authentication is supported.
  3384. .IP "NTLM_WB"
  3385. NTLM delegation to winbind helper is supported.
  3386. .IP "PSL"
  3387. PSL is short for Public Suffix List and means that this curl has been built
  3388. with knowledge about "public suffixes".
  3389. .IP "SPNEGO"
  3390. SPNEGO authentication is supported.
  3391. .IP "SSL"
  3392. SSL versions of various protocols are supported, such as HTTPS, FTPS, POP3S
  3393. and so on.
  3394. .IP "SSPI"
  3395. SSPI is supported.
  3396. .IP "TLS-SRP"
  3397. SRP (Secure Remote Password) authentication is supported for TLS.
  3398. .IP "TrackMemory"
  3399. Debug memory tracking is supported.
  3400. .IP "Unicode"
  3401. Unicode support on Windows.
  3402. .IP "UnixSockets"
  3403. Unix sockets support is provided.
  3404. .IP "zstd"
  3405. Automatic decompression (via zstd) of compressed files over HTTP is supported.
  3406. .RE
  3407. Example:
  3408. .nf
  3409. curl --version
  3410. .fi
  3411. .IP "\-w, \-\-write-out <format>"
  3412. Make curl display information on stdout after a completed transfer. The format
  3413. is a string that may contain plain text mixed with any number of
  3414. variables. The format can be specified as a literal "string", or you can have
  3415. curl read the format from a file with "@filename" and to tell curl to read the
  3416. format from stdin you write "@-".
  3417. The variables present in the output format will be substituted by the value or
  3418. text that curl thinks fit, as described below. All variables are specified as
  3419. %{variable_name} and to output a normal % you just write them as %%. You can
  3420. output a newline by using \\n, a carriage return with \\r and a tab space with
  3421. \\t.
  3422. The output will be written to standard output, but this can be switched to
  3423. standard error by using %{stderr}.
  3424. .B NOTE:
  3425. The %-symbol is a special symbol in the win32-environment, where all
  3426. occurrences of % must be doubled when using this option.
  3427. The variables available are:
  3428. .RS
  3429. .TP 15
  3430. .B content_type
  3431. The Content-Type of the requested document, if there was any.
  3432. .TP
  3433. .B errormsg
  3434. The error message. (Added in 7.75.0)
  3435. .TP
  3436. .B exitcode
  3437. The numerical exitcode of the transfer. (Added in 7.75.0)
  3438. .TP
  3439. .B filename_effective
  3440. The ultimate filename that curl writes out to. This is only meaningful if curl
  3441. is told to write to a file with the \fI\-O, \-\-remote-name\fP or \fI\-o, \-\-output\fP
  3442. option. It\(aqs most useful in combination with the \fI\-J, \-\-remote-header-name\fP
  3443. option.
  3444. .TP
  3445. .B ftp_entry_path
  3446. The initial path curl ended up in when logging on to the remote FTP
  3447. server.
  3448. .TP
  3449. .B http_code
  3450. The numerical response code that was found in the last retrieved HTTP(S) or
  3451. FTP(s) transfer.
  3452. .TP
  3453. .B http_connect
  3454. The numerical code that was found in the last response (from a proxy) to a
  3455. curl CONNECT request.
  3456. .TP
  3457. .B http_version
  3458. The http version that was effectively used. (Added in 7.50.0)
  3459. .TP
  3460. .B json
  3461. A JSON object with all available keys.
  3462. .TP
  3463. .B local_ip
  3464. The IP address of the local end of the most recently done connection \- can be
  3465. either IPv4 or IPv6.
  3466. .TP
  3467. .B local_port
  3468. The local port number of the most recently done connection.
  3469. .TP
  3470. .B method
  3471. The http method used in the most recent HTTP request. (Added in 7.72.0)
  3472. .TP
  3473. .B num_connects
  3474. Number of new connects made in the recent transfer.
  3475. .TP
  3476. .B num_headers
  3477. The number of response headers in the most recent request (restarted at each
  3478. redirect). Note that the status line IS NOT a header. (Added in 7.73.0)
  3479. .TP
  3480. .B num_redirects
  3481. Number of redirects that were followed in the request.
  3482. .TP
  3483. .B onerror
  3484. The rest of the output is only shown if the transfer returned a non-zero error
  3485. (Added in 7.75.0)
  3486. .TP
  3487. .B proxy_ssl_verify_result
  3488. The result of the HTTPS proxy\(aqs SSL peer certificate verification that was
  3489. requested. 0 means the verification was successful. (Added in 7.52.0)
  3490. .TP
  3491. .B redirect_url
  3492. When an HTTP request was made without \fI\-L, \-\-location\fP to follow redirects (or when
  3493. \fI\-\-max-redirs\fP is met), this variable will show the actual URL a redirect
  3494. \fIwould\fP have gone to.
  3495. .TP
  3496. .B referer
  3497. The Referer: header, if there was any. (Added in 7.76.0)
  3498. .TP
  3499. .B remote_ip
  3500. The remote IP address of the most recently done connection \- can be either
  3501. IPv4 or IPv6.
  3502. .TP
  3503. .B remote_port
  3504. The remote port number of the most recently done connection.
  3505. .TP
  3506. .B response_code
  3507. The numerical response code that was found in the last transfer (formerly
  3508. known as "http_code").
  3509. .TP
  3510. .B scheme
  3511. The URL scheme (sometimes called protocol) that was effectively used. (Added in 7.52.0)
  3512. .TP
  3513. .B size_download
  3514. The total amount of bytes that were downloaded. This is the size of the
  3515. body/data that was transferred, excluding headers.
  3516. .TP
  3517. .B size_header
  3518. The total amount of bytes of the downloaded headers.
  3519. .TP
  3520. .B size_request
  3521. The total amount of bytes that were sent in the HTTP request.
  3522. .TP
  3523. .B size_upload
  3524. The total amount of bytes that were uploaded. This is the size of the
  3525. body/data that was transferred, excluding headers.
  3526. .TP
  3527. .B speed_download
  3528. The average download speed that curl measured for the complete download. Bytes
  3529. per second.
  3530. .TP
  3531. .B speed_upload
  3532. The average upload speed that curl measured for the complete upload. Bytes per
  3533. second.
  3534. .TP
  3535. .B ssl_verify_result
  3536. The result of the SSL peer certificate verification that was requested. 0
  3537. means the verification was successful.
  3538. .TP
  3539. .B stderr
  3540. From this point on, the \fI\-w, \-\-write-out\fP output will be written to standard
  3541. error. (Added in 7.63.0)
  3542. .TP
  3543. .B stdout
  3544. From this point on, the \fI\-w, \-\-write-out\fP output will be written to standard output.
  3545. This is the default, but can be used to switch back after switching to stderr.
  3546. (Added in 7.63.0)
  3547. .TP
  3548. .B time_appconnect
  3549. The time, in seconds, it took from the start until the SSL/SSH/etc
  3550. connect/handshake to the remote host was completed.
  3551. .TP
  3552. .B time_connect
  3553. The time, in seconds, it took from the start until the TCP connect to the
  3554. remote host (or proxy) was completed.
  3555. .TP
  3556. .B time_namelookup
  3557. The time, in seconds, it took from the start until the name resolving was
  3558. completed.
  3559. .TP
  3560. .B time_pretransfer
  3561. The time, in seconds, it took from the start until the file transfer was just
  3562. about to begin. This includes all pre-transfer commands and negotiations that
  3563. are specific to the particular protocol(s) involved.
  3564. .TP
  3565. .B time_redirect
  3566. The time, in seconds, it took for all redirection steps including name lookup,
  3567. connect, pretransfer and transfer before the final transaction was
  3568. started. time_redirect shows the complete execution time for multiple
  3569. redirections.
  3570. .TP
  3571. .B time_starttransfer
  3572. The time, in seconds, it took from the start until the first byte was just
  3573. about to be transferred. This includes time_pretransfer and also the time the
  3574. server needed to calculate the result.
  3575. .TP
  3576. .B time_total
  3577. The total time, in seconds, that the full operation lasted.
  3578. .TP
  3579. .B url
  3580. The URL that was fetched. (Added in 7.75.0)
  3581. .TP
  3582. .B urlnum
  3583. The URL index number of this transfer, 0-indexed. De-globbed URLs share the
  3584. same index number as the origin globbed URL. (Added in 7.75.0)
  3585. .TP
  3586. .B url_effective
  3587. The URL that was fetched last. This is most meaningful if you have told curl
  3588. to follow location: headers.
  3589. .RE
  3590. .IP
  3591. If this option is used several times, the last one will be used.
  3592. Example:
  3593. .nf
  3594. curl -w '%{http_code}\\n' https://example.com
  3595. .fi
  3596. .IP "\-\-xattr"
  3597. When saving output to a file, this option tells curl to store certain file
  3598. metadata in extended file attributes. Currently, the URL is stored in the
  3599. xdg.origin.url attribute and, for HTTP, the content type is stored in
  3600. the mime_type attribute. If the file system does not support extended
  3601. attributes, a warning is issued.
  3602. Example:
  3603. .nf
  3604. curl --xattr -o storage https://example.com
  3605. .fi
  3606. .SH FILES
  3607. .I ~/.curlrc
  3608. .RS
  3609. Default config file, see \fI\-K, \-\-config\fP for details.
  3610. .SH ENVIRONMENT
  3611. The environment variables can be specified in lower case or upper case. The
  3612. lower case version has precedence. http_proxy is an exception as it is only
  3613. available in lower case.
  3614. Using an environment variable to set the proxy has the same effect as using
  3615. the \fI\-x, \-\-proxy\fP option.
  3616. .IP "http_proxy [protocol://]<host>[:port]"
  3617. Sets the proxy server to use for HTTP.
  3618. .IP "HTTPS_PROXY [protocol://]<host>[:port]"
  3619. Sets the proxy server to use for HTTPS.
  3620. .IP "[url-protocol]_PROXY [protocol://]<host>[:port]"
  3621. Sets the proxy server to use for [url-protocol], where the protocol is a
  3622. protocol that curl supports and as specified in a URL. FTP, FTPS, POP3, IMAP,
  3623. SMTP, LDAP, etc.
  3624. .IP "ALL_PROXY [protocol://]<host>[:port]"
  3625. Sets the proxy server to use if no protocol-specific proxy is set.
  3626. .IP "NO_PROXY <comma-separated list of hosts/domains>"
  3627. list of host names that should not go through any proxy. If set to an asterisk
  3628. \&\(aq*' only, it matches all hosts. Each name in this list is matched as either
  3629. a domain name which contains the hostname, or the hostname itself.
  3630. This environment variable disables use of the proxy even when specified with
  3631. the \fI\-x, \-\-proxy\fP option. That is
  3632. .B NO_PROXY=direct.example.com curl \-x http://proxy.example.com
  3633. .B http://direct.example.com
  3634. accesses the target URL directly, and
  3635. .B NO_PROXY=direct.example.com curl \-x http://proxy.example.com
  3636. .B http://somewhere.example.com
  3637. accesses the target URL through the proxy.
  3638. The list of host names can also be include numerical IP addresses, and IPv6
  3639. versions should then be given without enclosing brackets.
  3640. IPv6 numerical addresses are compared as strings, so they will only match if
  3641. the representations are the same: "::1" is the same as "::0:1" but they do not
  3642. match.
  3643. .IP "CURL_SSL_BACKEND <TLS backend>"
  3644. If curl was built with support for "MultiSSL", meaning that it has built-in
  3645. support for more than one TLS backend, this environment variable can be set to
  3646. the case insensitive name of the particular backend to use when curl is
  3647. invoked. Setting a name that is not a built-in alternative will make curl
  3648. stay with the default.
  3649. SSL backend names (case-insensitive): bearssl, gnutls, gskit, mbedtls,
  3650. mesalink, nss, openssl, rustls, schannel, secure-transport, wolfssl
  3651. .IP "QLOGDIR <directory name>"
  3652. If curl was built with HTTP/3 support, setting this environment variable to a
  3653. local directory will make curl produce qlogs in that directory, using file
  3654. names named after the destination connection id (in hex). Do note that these
  3655. files can become rather large. Works with both QUIC backends.
  3656. .IP "SSLKEYLOGFILE <file name>"
  3657. If you set this environment variable to a file name, curl will store TLS
  3658. secrets from its connections in that file when invoked to enable you to
  3659. analyze the TLS traffic in real time using network analyzing tools such as
  3660. Wireshark. This works with the following TLS backends: OpenSSL, libressl,
  3661. BoringSSL, GnuTLS, NSS and wolfSSL.
  3662. .SH "PROXY PROTOCOL PREFIXES"
  3663. The proxy string may be specified with a protocol:// prefix to specify
  3664. alternative proxy protocols.
  3665. If no protocol is specified in the proxy string or if the string does not match
  3666. a supported one, the proxy will be treated as an HTTP proxy.
  3667. The supported proxy protocol prefixes are as follows:
  3668. .IP "http://"
  3669. Makes it use it as an HTTP proxy. The default if no scheme prefix is used.
  3670. .IP "https://"
  3671. Makes it treated as an \fBHTTPS\fP proxy.
  3672. .IP "socks4://"
  3673. Makes it the equivalent of \fI\-\-socks4\fP
  3674. .IP "socks4a://"
  3675. Makes it the equivalent of \fI\-\-socks4a\fP
  3676. .IP "socks5://"
  3677. Makes it the equivalent of \fI\-\-socks5\fP
  3678. .IP "socks5h://"
  3679. Makes it the equivalent of \fI\-\-socks5-hostname\fP
  3680. .SH EXIT CODES
  3681. There are a bunch of different error codes and their corresponding error
  3682. messages that may appear under error conditions. At the time of this writing,
  3683. the exit codes are:
  3684. .IP 1
  3685. Unsupported protocol. This build of curl has no support for this protocol.
  3686. .IP 2
  3687. Failed to initialize.
  3688. .IP 3
  3689. URL malformed. The syntax was not correct.
  3690. .IP 4
  3691. A feature or option that was needed to perform the desired request was not
  3692. enabled or was explicitly disabled at build-time. To make curl able to do
  3693. this, you probably need another build of libcurl!
  3694. .IP 5
  3695. Could not resolve proxy. The given proxy host could not be resolved.
  3696. .IP 6
  3697. Could not resolve host. The given remote host could not be resolved.
  3698. .IP 7
  3699. Failed to connect to host.
  3700. .IP 8
  3701. Weird server reply. The server sent data curl could not parse.
  3702. .IP 9
  3703. FTP access denied. The server denied login or denied access to the particular
  3704. resource or directory you wanted to reach. Most often you tried to change to a
  3705. directory that does not exist on the server.
  3706. .IP 10
  3707. FTP accept failed. While waiting for the server to connect back when an active
  3708. FTP session is used, an error code was sent over the control connection or
  3709. similar.
  3710. .IP 11
  3711. FTP weird PASS reply. Curl could not parse the reply sent to the PASS request.
  3712. .IP 12
  3713. During an active FTP session while waiting for the server to connect back to
  3714. curl, the timeout expired.
  3715. .IP 13
  3716. FTP weird PASV reply, Curl could not parse the reply sent to the PASV request.
  3717. .IP 14
  3718. FTP weird 227 format. Curl could not parse the 227-line the server sent.
  3719. .IP 15
  3720. FTP cannot use host. Could not resolve the host IP we got in the 227-line.
  3721. .IP 16
  3722. HTTP/2 error. A problem was detected in the HTTP2 framing layer. This is
  3723. somewhat generic and can be one out of several problems, see the error message
  3724. for details.
  3725. .IP 17
  3726. FTP could not set binary. Could not change transfer method to binary.
  3727. .IP 18
  3728. Partial file. Only a part of the file was transferred.
  3729. .IP 19
  3730. FTP could not download/access the given file, the RETR (or similar) command
  3731. failed.
  3732. .IP 21
  3733. FTP quote error. A quote command returned error from the server.
  3734. .IP 22
  3735. HTTP page not retrieved. The requested url was not found or returned another
  3736. error with the HTTP error code being 400 or above. This return code only
  3737. appears if \fI\-f, \-\-fail\fP is used.
  3738. .IP 23
  3739. Write error. Curl could not write data to a local filesystem or similar.
  3740. .IP 25
  3741. FTP could not STOR file. The server denied the STOR operation, used for FTP
  3742. uploading.
  3743. .IP 26
  3744. Read error. Various reading problems.
  3745. .IP 27
  3746. Out of memory. A memory allocation request failed.
  3747. .IP 28
  3748. Operation timeout. The specified time-out period was reached according to the
  3749. conditions.
  3750. .IP 30
  3751. FTP PORT failed. The PORT command failed. Not all FTP servers support the PORT
  3752. command, try doing a transfer using PASV instead!
  3753. .IP 31
  3754. FTP could not use REST. The REST command failed. This command is used for
  3755. resumed FTP transfers.
  3756. .IP 33
  3757. HTTP range error. The range "command" did not work.
  3758. .IP 34
  3759. HTTP post error. Internal post-request generation error.
  3760. .IP 35
  3761. SSL connect error. The SSL handshaking failed.
  3762. .IP 36
  3763. Bad download resume. Could not continue an earlier aborted download.
  3764. .IP 37
  3765. FILE could not read file. Failed to open the file. Permissions?
  3766. .IP 38
  3767. LDAP cannot bind. LDAP bind operation failed.
  3768. .IP 39
  3769. LDAP search failed.
  3770. .IP 41
  3771. Function not found. A required LDAP function was not found.
  3772. .IP 42
  3773. Aborted by callback. An application told curl to abort the operation.
  3774. .IP 43
  3775. Internal error. A function was called with a bad parameter.
  3776. .IP 45
  3777. Interface error. A specified outgoing interface could not be used.
  3778. .IP 47
  3779. Too many redirects. When following redirects, curl hit the maximum amount.
  3780. .IP 48
  3781. Unknown option specified to libcurl. This indicates that you passed a weird
  3782. option to curl that was passed on to libcurl and rejected. Read up in the
  3783. manual!
  3784. .IP 49
  3785. Malformed telnet option.
  3786. .IP 51
  3787. The peer\(aqs SSL certificate or SSH MD5 fingerprint was not OK.
  3788. .IP 52
  3789. The server did not reply anything, which here is considered an error.
  3790. .IP 53
  3791. SSL crypto engine not found.
  3792. .IP 54
  3793. Cannot set SSL crypto engine as default.
  3794. .IP 55
  3795. Failed sending network data.
  3796. .IP 56
  3797. Failure in receiving network data.
  3798. .IP 58
  3799. Problem with the local certificate.
  3800. .IP 59
  3801. Could not use specified SSL cipher.
  3802. .IP 60
  3803. Peer certificate cannot be authenticated with known CA certificates.
  3804. .IP 61
  3805. Unrecognized transfer encoding.
  3806. .IP 62
  3807. Invalid LDAP URL.
  3808. .IP 63
  3809. Maximum file size exceeded.
  3810. .IP 64
  3811. Requested FTP SSL level failed.
  3812. .IP 65
  3813. Sending the data requires a rewind that failed.
  3814. .IP 66
  3815. Failed to initialise SSL Engine.
  3816. .IP 67
  3817. The user name, password, or similar was not accepted and curl failed to log in.
  3818. .IP 68
  3819. File not found on TFTP server.
  3820. .IP 69
  3821. Permission problem on TFTP server.
  3822. .IP 70
  3823. Out of disk space on TFTP server.
  3824. .IP 71
  3825. Illegal TFTP operation.
  3826. .IP 72
  3827. Unknown TFTP transfer ID.
  3828. .IP 73
  3829. File already exists (TFTP).
  3830. .IP 74
  3831. No such user (TFTP).
  3832. .IP 75
  3833. Character conversion failed.
  3834. .IP 76
  3835. Character conversion functions required.
  3836. .IP 77
  3837. Problem reading the SSL CA cert (path? access rights?).
  3838. .IP 78
  3839. The resource referenced in the URL does not exist.
  3840. .IP 79
  3841. An unspecified error occurred during the SSH session.
  3842. .IP 80
  3843. Failed to shut down the SSL connection.
  3844. .IP 82
  3845. Could not load CRL file, missing or wrong format.
  3846. .IP 83
  3847. Issuer check failed.
  3848. .IP 84
  3849. The FTP PRET command failed.
  3850. .IP 85
  3851. Mismatch of RTSP CSeq numbers.
  3852. .IP 86
  3853. Mismatch of RTSP Session Identifiers.
  3854. .IP 87
  3855. Unable to parse FTP file list.
  3856. .IP 88
  3857. FTP chunk callback reported error.
  3858. .IP 89
  3859. No connection available, the session will be queued.
  3860. .IP 90
  3861. SSL public key does not matched pinned public key.
  3862. .IP 91
  3863. Invalid SSL certificate status.
  3864. .IP 92
  3865. Stream error in HTTP/2 framing layer.
  3866. .IP 93
  3867. An API function was called from inside a callback.
  3868. .IP 94
  3869. An authentication function returned an error.
  3870. .IP 95
  3871. A problem was detected in the HTTP/3 layer. This is somewhat generic and can
  3872. be one out of several problems, see the error message for details.
  3873. .IP 96
  3874. QUIC connection error. This error may be caused by an SSL library error. QUIC
  3875. is the protocol used for HTTP/3 transfers.
  3876. .IP XX
  3877. More error codes will appear here in future releases. The existing ones
  3878. are meant to never change.
  3879. .SH AUTHORS / CONTRIBUTORS
  3880. Daniel Stenberg is the main author, but the whole list of contributors is
  3881. found in the separate THANKS file.
  3882. .SH WWW
  3883. https://curl.se
  3884. .SH "SEE ALSO"
  3885. .BR ftp (1),
  3886. .BR wget (1)