Loading... # Linux CMD curl ## Requset ```bash bash > curl cip.cc # redirection bash > curl -L http://cip.cc # display header info & content bash > curl -i cip.cc # custom the User-Agent bash > curl -A "Mozilla/5.0 (Android; Mobile; rv:35.0) Gecko/35.0 Firefox/35.0" google.com # custom the header bash > curl -H "Referer: www.baidu.com" -H "User-Agent: Custom-User-Agent" baidu.com # append the referer bash > curl -e "www.linux.com" http://mail.linux.com ``` ## Download ```bash # save to file bash > curl -o baidu.html baidu.com bash > curl baidu.com > baidu.html bash > curl -O baidu.com # default name index.html # download 2 files bash > curl -O baidu.com -O google.com # resume the download bash > curl -C -O google.com ``` ## Authority ```bash bash > curl -u username:password {{ url }} bash > curl -u username {{ url }} ``` ## Request FTP server ```bash # all files bash > curl -u {{ user }}:{{ pwd }} -O ftp://{{ ip }}/downLoad/ # signal file bash > curl -u {{ user }}:{{ pwd }} -O ftp://{{ ip }}/downLoad/xxx.jpg bash > curl -O ftp://{{ user }}:{{ pwd }}@{{ ip }}/xxxx.JPG bash > curl -u {{ user }}:{{ pwd }} -T test.html ftp://{{ ip }} bash > curl -u {{ user }}:{{ pwd }} -T "{file,file}" ftp://{{ ip }} ``` ## Proxy ```bash # http https proxy bash > curl -x 127.0.0.1:3128 google.com # socket5 bash > curl --socks5 127.0.0.1:1080 google.com ``` ## Cookie ```bash # save cookie info to file bash > curl -D {{ filepath }} localhost # use the cookie file bash > curl -b {{ filepath }} localhost bash > curl -b "JSESSIONID=D0112A5063D938586B659EF8F939BE24" localhost # use the cookie to login bash > curl -c "cookie-login" -d "userName=test&passwd=test" http://www.example.com/login bash > curl -b "cookie-login" http://www.example.com/login ``` * ``` © Reprint prohibited Support Appreciate the author AliPayWeChat Like If you think my article is useful to you, please feel free to appreciate