经常使用命令行,比如 curl 测试接口响应时间,
- for i in {1..10};do curl -o /dev/null -s -w "$i | time_namelookup: %{time_namelookup} | time_connect: %{time_connect} | time_starttransfer: %{time_starttransfer} | time_total: %{time_total}
- " "http://httpbin.org/ip";done
-
- 1 | time_namelookup: 0.016000 | time_connect: 0.016000 | time_starttransfer: 0.125000 | time_total: 0.141000
- 2 | time_namelookup: 0.016000 | time_connect: 0.016000 | time_starttransfer: 0.094000 | time_total: 0.109000
- 3 | time_namelookup: 0.016000 | time_connect: 0.031000 | time_starttransfer: 0.109000 | time_total: 0.109000
- 4 | time_namelookup: 0.015000 | time_connect: 0.031000 | time_starttransfer: 0.109000 | time_total: 0.109000
- 5 | time_namelookup: 0.031000 | time_connect: 0.031000 | time_starttransfer: 0.109000 | time_total: 0.109000
- 6 | time_namelookup: 0.016000 | time_connect: 0.016000 | time_starttransfer: 0.094000 | time_total: 0.109000
- 7 | time_namelookup: 0.016000 | time_connect: 0.016000 | time_starttransfer: 0.125000 | time_total: 0.125000
- 8 | time_namelookup: 0.000001 | time_connect: 0.016000 | time_starttransfer: 0.141000 | time_total: 0.141000
- 9 | time_namelookup: 0.015000 | time_connect: 0.015000 | time_starttransfer: 0.093000 | time_total: 0.109000
- 10 | time_namelookup: 0.000001 | time_connect: 0.015000 | time_starttransfer: 0.109000 | time_total: 0.125000
奈何命令行参数太多,记不住怎么办?这时候你需要个男人,它就是 man。
man
- #man curl
- curl(1) Curl Manual curl(1)
-
- NAME
- curl - transfer a URL
-
- SYNOPSIS
- curl [options] [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, 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 authentication, FTP upload,
- HTTP post, SSL connections, cookies, file transfer 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.
-
- URL
- The URL syntax is protocol-dependent. You'll find a detailed description in RFC 3986.
-
- You can specify multiple URLs or parts of URLs by writing part sets within braces as in:
-
- http://site.{one,two,three}.com
-
- or you can get sequences of alphanumeric series by using [] as in:
-
- ftp://ftp.numericals.com/file[1-100].txt
- ftp://ftp.numericals.com/file[001-100].txt (with leading zeros)
- ftp://ftp.letters.com/file[a-z].txt
男人的确很强悍,给出了这么多提示,但没有我真正想要的。。。还是不知道怎么用。
相信你在技术文章里经常会看到 TL;DR 即Too Long; Didn’t Read. 太长不看, man curl 的内容就是太长了,我不看。
就是这个更强壮的男人 tldr,它一个命令行工具,直接使用 npm install -g tldr 来安装。
(编辑:ASP站长网)
|