5/29/2017 5basiccURLcommandexamplesRoseHosting.
comBlog
5basiccURLcommandexamples
OCTOBER21,2016 1 TIPSANDTRICKS
Facebook 0 Twitter 8 Google+ 2 Linkedin 2
[Link]
likeFILE,HTTP,HTTPS,IMAP,IMAPS,LDAP,DICT,LDAPS,TELNET,FTP,FTPS,GOPHER,RTMP,
RTSP,SCP,SFTP,POP3,POP3S,SMB,SMBS,SMTP,SMTPS,andTFTP.
[Link],uploadandmanage
files,checkyouremailaddress,orevenupdateyourstatusonsomeofthesocialmediawebsitesorcheckthe
[Link]
VPS.
[Link]
OneofthemostcommonandsimplestusesofcURListypingthecommanditself,followedbytheURLyou
wanttocheck
[Link] 1/4
5/29/2017 [Link]
curl[Link]
ThiscommandwilldisplaythecontentoftheURLonyourterminal
[Link]
TheoutputofthecURLcommandcanbeeasilysavedtoafilebyaddingtheooptiontothecommand,as
shownbelow
curlowebsite[Link]
%Total%Received%XferdAverageSpeedTimeTimeTimeCurrent
DloadUploadTotalSpentLeftSpeed
1004179304179300275k0::::::2.9M
Inthisexample,outputwillbesavetoafilenamedwebsiteinthecurrentworkingdirectory.
[Link]
[Link]
localserverwiththesamenamesasontheremoteserver
curlO[Link]
Inthisexample,[Link].
YoucanalsodownloadthefilewithadifferentnamebyaddingtheooptiontocURL.
[Link]://[Link]/[Link]
[Link].
[Link] 2/4
5/29/2017 [Link]
cURLcanbealsousedtodownloadmultiplefilessimultaneously,asshownintheexamplebelow
curlO[Link]
cURLcanbealsousedtodownloadfilessecurelyviaSSHusingthefollowingcommand
curluusers[Link]
Notethatyouhavetousethefullpathofthefileyouwanttodownload
[Link]
YoucaneasilygetHTTPheaderinformationfromanywebsiteyouwantbyaddingtheIoption(capitali)to
cURL.
curlI[Link]
HTTP/1.1200OK
Date:Sun,16Oct201623:37:15GMT
Server:Apache/2.4.23(Unix)
XPoweredBy:PHP/5.6.24
Connection:close
ContentType:text/html;charset=UTF8
[Link]
ToaccessyourFTPserverwithcURLusethefollowingcommand
curl[Link]
[Link] 3/4
5/29/2017 [Link]
cURLwillconnecttotheFTPserverandlistallfilesanddirectoriesinusershomedirectory
YoucandownloadafileviaFTP
curl[Link]
anduploadafileottheFTPserver
[Link]://[Link]/userusername:password
YoucancheckcURLmanualpagetoseeallavailablecURLoptionsandfunctionalities
mancurl
[Link] 4/4