curl -L -O --limit-rate -u -T -x --mail-from --mail-rcpt


curl -? transfer a URL


DESCRIPTION


curl is a tool to transfer data from or to a server, using one of the supported protocols (DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET and TFTP).The command is designed to work without user interaction.


curl offers a busload of useful tricks like proxy support, user authen- tication, FTP upload, HTTP post, SSL connections, cookies, file trans- fer resume, Metalink, and more. As you will see below, the number of features will make your head spin! curl is powered by libcurl for all transfer-related features. See libcurl(3) for details.


1. curl? URL -L? ?###if request page redirected, than redo the request to the new location

curl -L

2. curl -O URL? ? ?###save response to a local file named as the extracted string from the URL given, if there is no remote file used in given URL, then an error 'Remote file name has no length!' appears. example:

$ curl -O https://baijia.baidu.com/s?id=1595691372942034482&wfr=pc&fr=idx_lst

? ? ? ? ? ? ? ? ? ? ?execution result: filename is 's_id=1595691372942034482'

curl -O

3. curl --limit-rate 1024(0r xxxx)? URL? ? ###to limit the download rate to xxxx

$ curl --limit-rate 1024 -O http://www.gov.cn/zhengce/content/2017-11/30/content_5243579.htm

? % Total? ? % Received % Xferd? Average Speed? Time? ? Time? ? Time? Current

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Dload? Upload? Total? Spent? ? Left? Speed

100 16860? ? 0 16860? ? 0? ? 0? 1035? ? ? 0 --:--:--? 0:00:16 --:--:--? 1227

$ curl -O http://www.gov.cn/zhengce/content/2017-11/30/content_5243579.htm

? % Total? ? % Received % Xferd? Average Speed? Time? ? Time? ? Time? Current Dload? Upload? Total? Spent? ? Left? Speed

? ? ? 100 16860? ? 0 16860? ? 0? ? 0? 98023? ? ? 0? ? ? ? ?--:? ? ? ?--:? ?-- --? ? ?:--? ? ?:--? ? ? ? ? ? --:? ? ? --:? ? --? ? ? ? ? ? ? ? ? ??105k(105*1024)

4. Authentication in curl:? curl -u username:password URL


5. upload file to a ftp: curl -u ftpuser:ftpassword -T "{file1, file2, ..., file-N}"? ftp://ftp.server.test


6. using a proxy to download:? curl -x proxyIp:proxyPort? ?URL


7. Send mail using SMTP:? curl --mail-from mail@test.com --mail-rcpt mail2@test.com smtp://smtpserver.com

8. curl commands in multiple lines, formatting:

? ? ? ? ? ? curl http://www.sitename.com \

? ? ? ? ? ? ? ? ? ? -H "HEADERS......"? \

? ? ? ? ? ? ? ? ? ? -o output.filename \

? ? ? ? ? ? ? ? ? ? ?.? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ###Once after typing the message, type '.' to send it immediately.

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末腊徙,一起剝皮案震驚了整個濱河市,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌在刺,老刑警劉巖虱痕,帶你破解...
    沈念sama閱讀 212,542評論 6 493
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件吴汪,死亡現(xiàn)場離奇詭異,居然都是意外死亡武花,警方通過查閱死者的電腦和手機沧竟,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 90,596評論 3 385
  • 文/潘曉璐 我一進店門铸敏,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人屯仗,你說我怎么就攤上這事搞坝。” “怎么了魁袜?”我有些...
    開封第一講書人閱讀 158,021評論 0 348
  • 文/不壞的土叔 我叫張陵桩撮,是天一觀的道長敦第。 經(jīng)常有香客問我,道長店量,這世上最難降的妖魔是什么芜果? 我笑而不...
    開封第一講書人閱讀 56,682評論 1 284
  • 正文 為了忘掉前任,我火速辦了婚禮融师,結(jié)果婚禮上右钾,老公的妹妹穿的比我還像新娘。我一直安慰自己旱爆,他們只是感情好舀射,可當我...
    茶點故事閱讀 65,792評論 6 386
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著怀伦,像睡著了一般脆烟。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上房待,一...
    開封第一講書人閱讀 49,985評論 1 291
  • 那天邢羔,我揣著相機與錄音,去河邊找鬼桑孩。 笑死拜鹤,一個胖子當著我的面吹牛,可吹牛的內(nèi)容都是我干的流椒。 我是一名探鬼主播敏簿,決...
    沈念sama閱讀 39,107評論 3 410
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼镣隶!你這毒婦竟也來了极谊?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 37,845評論 0 268
  • 序言:老撾萬榮一對情侶失蹤安岂,失蹤者是張志新(化名)和其女友劉穎,沒想到半個月后帆吻,有當?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體域那,經(jīng)...
    沈念sama閱讀 44,299評論 1 303
  • 正文 獨居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 36,612評論 2 327
  • 正文 我和宋清朗相戀三年猜煮,在試婚紗的時候發(fā)現(xiàn)自己被綠了次员。 大學時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點故事閱讀 38,747評論 1 341
  • 序言:一個原本活蹦亂跳的男人離奇死亡王带,死狀恐怖淑蔚,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情愕撰,我是刑警寧澤刹衫,帶...
    沈念sama閱讀 34,441評論 4 333
  • 正文 年R本政府宣布醋寝,位于F島的核電站,受9級特大地震影響带迟,放射性物質(zhì)發(fā)生泄漏音羞。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點故事閱讀 40,072評論 3 317
  • 文/蒙蒙 一仓犬、第九天 我趴在偏房一處隱蔽的房頂上張望嗅绰。 院中可真熱鬧,春花似錦搀继、人聲如沸窘面。這莊子的主人今日做“春日...
    開封第一講書人閱讀 30,828評論 0 21
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽财边。三九已至,卻和暖如春险毁,著一層夾襖步出監(jiān)牢的瞬間制圈,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 32,069評論 1 267
  • 我被黑心中介騙來泰國打工畔况, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留鲸鹦,地道東北人。 一個月前我還...
    沈念sama閱讀 46,545評論 2 362
  • 正文 我出身青樓跷跪,卻偏偏與公主長得像馋嗜,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個殘疾皇子吵瞻,可洞房花燭夜當晚...
    茶點故事閱讀 43,658評論 2 350

推薦閱讀更多精彩內(nèi)容