加入收藏 | 设为首页 | 会员中心 | 我要投稿 网站开发网_马鞍山站长网 (https://www.0555zz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长百科 > 正文

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

发布时间:2019-09-18 20:55:34 所属栏目:站长百科 来源:佚名
导读:副标题#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.

如果你不想安装tldr,也可以直接使用网页在线查看https://tldr.sh/

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

有了tldr,妈妈再也不用担心我记不住命令行参数了,还有没有比 tldr更强悍的男人呢,有,比如cheat https://github.com/cheat/cheat ,直接使用pip install cheat安装。

cheat

看看 cheat 怎么用吧

  1. $ cheat cheat 
  2. # To see example usage of a program: 
  3. cheat <command> 
  4.  
  5. # To edit a cheatsheet 
  6. cheat -e <command> 
  7.  
  8. # To list available cheatsheets 
  9. cheat -l 
  10.  
  11. # To search available cheatsheets 
  12. cheat -s <command> 
  13.  
  14. # To get the current `cheat' version 
  15. cheat -v 

试试 curl

  1. $ cheat curl 
  2. # Download a single file 
  3. curl http://path.to.the/file 
  4.  
  5. # Download a file and specify a new filename 
  6. curl http://example.com/file.zip -o new_file.zip 
  7.  
  8. # Download multiple files 
  9. curl -O URLOfFirstFile -O URLOfSecondFile 
  10.  
  11. # Download all sequentially numbered files (1-24) 
  12. curl http://example.com/pic[1-24].jpg 
  13.  
  14. # Download a file and pass HTTP Authentication 
  15. curl -u username:password URL 
  16.  
  17. # Download a file with a Proxy 
  18. curl -x proxysever.server.com:PORT http://addressiwantto.access 
  19.  
  20. # Download a file from FTP 
  21. curl -u username:password -O ftp://example.com/pub/file.zip 
  22.  
  23. # Get an FTP directory listing 
  24. curl ftp://username:password@example.com 
  25.  
  26. # Resume a previously failed download 
  27. curl -C - -o partial_file.zip http://example.com/file.zip 
  28.  
  29. # Fetch only the HTTP headers from a response 
  30. curl -I http://example.com 
  31.  
  32. # Fetch your external IP and network info as JSON 
  33. curl http://ifconfig.me/all/json 
  34.  
  35. # Limit the rate of a download 
  36. curl --limit-rate 1000B -O http://path.to.the/file 
  37.  
  38. # Get your global IP 
  39. curl httpbin.org/ip 
  40.  
  41. # Get only the HTTP status code 
  42. curl -o /dev/null -w '%{http_code} 
  43. ' -s -I URL 

比tldr更详细,如果你也不想安装可以直接使用curl

(编辑:网站开发网_马鞍山站长网)

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