加入收藏 | 设为首页 | 会员中心 | 我要投稿 源码网 (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.

嗯,很简洁,直接给出了tar需要的参数,再来看curl

  1. λ tldr curl 
  2.  
  3.   curl 
  4.  
  5.   Transfers data from or to a server. 
  6.   Supports most protocols, including HTTP, FTP, and POP3. 
  7.  
  8.   - Download the contents of an URL to a file: 
  9.     curl http://example.com -o filename 
  10.  
  11.   - Download a file, saving the output under the filename indicated by the URL: 
  12.     curl -O http://example.com/filename 
  13.  
  14.   - Download a file, following [L]ocation redirects, and automatically [C]ontinuing (resuming) a previous file transfer: 
  15.     curl -O -L -C - http://example.com/filename 
  16.  
  17.   - Send form-encoded data (POST request of type application/x-www-form-urlencoded): 
  18.     curl -d 'name=bob' http://example.com/form 
  19.  
  20.   - Send a request with an extra header, using a custom HTTP method: 
  21.     curl -H 'X-My-Header: 123' -X PUT http://example.com 
  22.  
  23.   - Send data in JSON format, specifying the appropriate content-type header: 
  24.     curl -d '{"name":"bob"}' -H 'Content-Type: application/json' http://example.com/users/1234 
  25.  
  26.   - Pass a user name and password for server authentication: 
  27.     curl -u myusername:mypassword http://example.com 
  28.  
  29.   - Pass client certificate and key for a resource, skipping certificate validation: 
  30.     curl --cert client.pem --key key.pem --insecure https://example.com 

这个男人果然更强悍,常用的curl命令都包括了,我喜欢。

除了自带的命令,安装的命令也可以

  1. [root@VM_0_14_centos ~]# tldr python 
  2.  
  3.   python 
  4.  
  5.   Python language interpreter. 
  6.   More information: https://www.python.org. 
  7.  
  8.   - Call a Python interactive shell (REPL): 
  9.     python 
  10.  
  11.   - Execute script in a given Python file: 
  12.     python script.py 
  13.  
  14.   - Execute script as part of an interactive shell: 
  15.     python -i script.py 
  16.  
  17.   - Execute a Python expression: 
  18.     python -c "expression" 
  19.  
  20.   - Run library module as a script (terminates option list): 
  21.     python -m module arguments 
  22.  
  23.   - Interactively debug a Python script: 
  24.     python -m pdb script.py 

除了node 还有其他版本 https://github.com/tldr-pages/tldr

比如Python,直接pip install tldr安装。

(编辑:源码网)

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

热点阅读