加入收藏 | 设为首页 | 会员中心 | 我要投稿 源码网 (https://www.900php.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 服务器 > 搭建环境 > Windows > 正文

比man更强悍的命令行工具cheat

发布时间:2019-09-19 14:51:58 所属栏目:Windows 来源:佚名
导读:副标题#e# 经常使用命令行,比如 curl 测试接口响应时间, foriin{1..10};docurl-o/dev/null-s-w$i|time_namelookup:%{time_namelookup}|time_connect:%{time_connect}|time_starttransfer:%{time_starttransfer}|time_total:%{time_total} http://httpbin.
副标题[/!--empirenews.page--]

经常使用命令行,比如 curl 测试接口响应时间,

  1. 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} 
  2. " "http://httpbin.org/ip";done 
  3.  
  4. 1 | time_namelookup: 0.016000 | time_connect: 0.016000 | time_starttransfer: 0.125000 | time_total: 0.141000 
  5. 2 | time_namelookup: 0.016000 | time_connect: 0.016000 | time_starttransfer: 0.094000 | time_total: 0.109000 
  6. 3 | time_namelookup: 0.016000 | time_connect: 0.031000 | time_starttransfer: 0.109000 | time_total: 0.109000 
  7. 4 | time_namelookup: 0.015000 | time_connect: 0.031000 | time_starttransfer: 0.109000 | time_total: 0.109000 
  8. 5 | time_namelookup: 0.031000 | time_connect: 0.031000 | time_starttransfer: 0.109000 | time_total: 0.109000 
  9. 6 | time_namelookup: 0.016000 | time_connect: 0.016000 | time_starttransfer: 0.094000 | time_total: 0.109000 
  10. 7 | time_namelookup: 0.016000 | time_connect: 0.016000 | time_starttransfer: 0.125000 | time_total: 0.125000 
  11. 8 | time_namelookup: 0.000001 | time_connect: 0.016000 | time_starttransfer: 0.141000 | time_total: 0.141000 
  12. 9 | time_namelookup: 0.015000 | time_connect: 0.015000 | time_starttransfer: 0.093000 | time_total: 0.109000 
  13. 10 | time_namelookup: 0.000001 | time_connect: 0.015000 | time_starttransfer: 0.109000 | time_total: 0.125000 

奈何命令行参数太多,记不住怎么办?这时候你需要个男人,它就是 man。

man

  1. #man curl  
  2. curl(1)                                      Curl Manual                                     curl(1) 
  3.  
  4. NAME 
  5.        curl - transfer a URL 
  6.  
  7. SYNOPSIS 
  8.        curl [options] [URL...] 
  9.  
  10. DESCRIPTION 
  11.        curl  is  a  tool  to transfer data from or to a server, using one of the supported protocols 
  12.        (DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP,  LDAPS,  POP3,  POP3S,  RTMP, 
  13.        RTSP, SCP, SFTP, SMTP, SMTPS, TELNET and TFTP).  The command is designed to work without user 
  14.        interaction. 
  15.  
  16.        curl offers a busload of useful tricks like proxy support, user authentication,  FTP  upload, 
  17.        HTTP  post,  SSL  connections, cookies, file transfer resume, Metalink, and more. As you will 
  18.        see below, the number of features will make your head spin! 
  19.  
  20.        curl is powered by libcurl for all transfer-related features. See libcurl(3) for details. 
  21.  
  22. URL 
  23.        The URL syntax is protocol-dependent. You'll find a detailed description in RFC 3986. 
  24.  
  25.        You can specify multiple URLs or parts of URLs by writing part sets within braces as in: 
  26.  
  27.         http://site.{one,two,three}.com 
  28.  
  29.        or you can get sequences of alphanumeric series by using [] as in: 
  30.  
  31.         ftp://ftp.numericals.com/file[1-100].txt 
  32.         ftp://ftp.numericals.com/file[001-100].txt    (with leading zeros) 
  33.         ftp://ftp.letters.com/file[a-z].txt 

男人的确很强悍,给出了这么多提示,但没有我真正想要的。。。还是不知道怎么用。

相信你在技术文章里经常会看到 TL;DR 即Too Long; Didn’t Read. 太长不看, man curl 的内容就是太长了,我不看。

就是这个更强壮的男人 tldr,它一个命令行工具,直接使用 npm install -g tldr 来安装。

(编辑:源码网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

热点阅读