0% found this document useful (0 votes)
23 views4 pages

Basic cURL Command Examples

This document provides 5 examples of basic cURL commands: 1) Check a URL, 2) Save a URL's output to a file, 3) Download files, 4) Get HTTP header information, and 5) Access an FTP server. cURL is a command line tool that can be used to transfer data to and from servers using various protocols like HTTP, HTTPS, FTP, and more. The examples demonstrate how to view website content, save web pages locally, download files, view HTTP headers, and transfer files via FTP.

Uploaded by

semabay
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views4 pages

Basic cURL Command Examples

This document provides 5 examples of basic cURL commands: 1) Check a URL, 2) Save a URL's output to a file, 3) Download files, 4) Get HTTP header information, and 5) Access an FTP server. cURL is a command line tool that can be used to transfer data to and from servers using various protocols like HTTP, HTTPS, FTP, and more. The examples demonstrate how to view website content, save web pages locally, download files, view HTTP headers, and transfer files via FTP.

Uploaded by

semabay
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

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

You might also like