curl -o baidu2.html 'http://www.baidu.com/s?wd=%B2%C6%BE%AD&pn=20'
curl -A "Mozilla/4.0" -d "formhash=${tidhash}&subject=&usesig=0&message=okle8888" -b bbscookie.txt -o ok.html "http://192.168.1.102/dz/post.php?action=reply&fid=2&tid=2&extra=page=1&replysubmit=yes&infloat=yes&handlekey=fastpost&inajax=1"
[beyes@SLinux phpwind]$ curl --trace-ascii debugdump.txt http://www.baidu.com
== Info: About to connect() to www.baidu.com port 80 (#0)
== Info: Trying 220.181.111.148... == Info: connected
== Info: Connected to www.baidu.com (220.181.111.148) port 80 (#0)
=> Send header, 164 bytes (0xa4)
0000: GET / HTTP/1.1
0010: User-Agent: curl/7.19.7 (i386-koji-linux-gnu) libcurl/7.19.7 NSS
0050: /3.12.7.0 zlib/1.2.3 libidn/1.18 libssh2/1.2.2
0080: Host: www.baidu.com
0095: Accept: */*
00a2:
<= Recv header, 17 bytes (0x11)
0000: HTTP/1.1 200 OK
<= Recv header, 37 bytes (0x25)
0000: Date: Thu, 21 Apr 2011 06:26:16 GMT
<= Recv header, 17 bytes (0x11)
0000: Server: BWS/1.0
<= Recv header, 22 bytes (0x16)
0000: Content-Length: 6759
<= Recv header, 40 bytes (0x28)
0000: Content-Type: text/html;charset=gb2312
<= Recv header, 24 bytes (0x18)
0000: Cache-Control: private
<= Recv header, 40 bytes (0x28)
0000: Expires: Thu, 21 Apr 2011 06:26:16 GMT
<= Recv header, 123 bytes (0x7b)
0000: Set-Cookie: BAIDUID=5015985CDC4675C8E24D9B17DF344214:FG=1; expir
0040: es=Thu, 21-Apr-41 06:26:16 GMT; path=/; domain=.baidu.com
<= Recv header, 41 bytes (0x29)
0000: P3P: CP=" OTI DSP COR IVA OUR IND COM "
<= Recv header, 24 bytes (0x18)
0000: Connection: Keep-Alive
<= Recv header, 2 bytes (0x2)
0000:
<= Recv data, 3472 bytes (0xd90)
0000: <!doctype html><html><head><meta http-equiv="Content-Type" conte
... ... ...
[beyes@SLinux phpwind]$ curl --trace-ascii - http://www.baidu.com
[beyes@SLinux phpwind]$ curl --head http://www.baidu.com
HTTP/1.1 200 OK
Date: Thu, 21 Apr 2011 07:01:14 GMT
Server: BWS/1.0
Content-Length: 6759
Content-Type: text/html;charset=gb2312
Cache-Control: private
Expires: Thu, 21 Apr 2011 07:01:14 GMT
Set-Cookie: BAIDUID=E6BBE58C512A0F796D7E559A14F5825B:FG=1; expires=Thu, 21-Apr-41 07:01:14 GMT; path=/; domain=.baidu.com
P3P: CP=" OTI DSP COR IVA OUR IND COM "
Connection: Keep-Alive
$ curl -o mnv.jpg --referer http://www.groad.net/ http://hiphotos.baidu.com/gonten ... 268d99fd1a2d3ee.jpg
$ curl -o mnv.jpg --referer http://www.baidu.com/ http://hiphotos.baidu.com/gonten ... 268d99fd1a2d3ee.jpg
multipart/form-data |
curl -F "myfile=@baby2.gif" http://192.168.1.106/php/upload/upload.php
$_FILES |
<?php
$upload_dir = "./p_w_upload/";
$upload_file = $upload_dir . iconv("UTF-8", "Gb2312", $_FILES["myfile"]["name"]);
if (move_uploaded_file($_FILES["myfile"]["tmp_name"], $upload_file)) {
echo "<strong>upload ok</strong><hr>";
echo "filename:" . $_FILES["myfile"]["name"] . "<br>";
echo "tmp filename:" . $_FILES["myfile"]["tmp_name"]."<br>";
echo "file size:" . $_FILES["myfile"]["size"] . "<br>";
echo "file type:" . $_FILES["myfile"]["type"] . "<br>";
echo "<p><a href='javascript:history.back()'>go on your upload</a></p>";
} else {
echo "upload failed"."<bur>";
echo "<a href='javascript:history.back()'>reupload</a>";
}
?>
curl -u admin:your-password "http://192.168.1.1"
curl -u admin:password "http://192.168.1.1" -L "http://192.168.1.1:8080"
$ curl URL/download_file -C offset
# curl -o xunlei.exe http://down.sandai.net/thunder7/Thunder7.2.6.3428.exe
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 25.2M 0 144k 0 0 105k 0 0:04:06 0:00:01 0:04:05 114k^C/quote]
上面 ^C 表示按下 Ctrl + C 中断下载。
查看已经下载的文件大小:
[quote]# ls -alh
total 264K
drwxr-xr-x 2 root root 4.0K 2012-04-09 00:17 .
drwxr-xr-x 6 root root 4.0K 2012-04-08 22:05 ..
-rw-r--r-- 1 root root 86K 2012-04-08 22:06 history-1.html
-rw-r--r-- 1 root root 168K 2012-04-09 00:17 xunlei.exe
# curl -o xunlei.exe -C - http://down.sandai.net/thunder7/Thunder7.2.6.3428.exe
** Resuming transfer from byte position 172032
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
2 25.1M 2 625k 0 0 232k 0 0:01:50 0:00:02 0:01:48 241k^C
# curl -o xunlei.exe http://down.sandai.net/thunder7/Thunder7.2.6.3428.exe --limit-rate 20k
# curl -o xunlei.exe http://down.sandai.net/thunder7/Thunder7.2.6.3428.exe --limit-rate 20k --max-filesize 500
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (63) Maximum file size exceeded
$ curl -s -O http://farm5.staticflickr.com/4056/5168441085_778bc29818_t.jpg
curl -A $user_agent -b login_cookies.txt -d "username=$myname" "http://www.groad.net/login.php
url -A $user_agent -c login_cookies.txt -G "http://www.groad.net/login.php
欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) | Powered by Discuz! X3.2 |