国产精品电影_久久视频免费_欧美日韩国产激情_成年人视频免费在线播放_日本久久亚洲电影_久久都是精品_66av99_九色精品美女在线_蜜臀a∨国产成人精品_冲田杏梨av在线_欧美精品在线一区二区三区_麻豆mv在线看

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

系統 Linux
經常使用命令行,比如 curl 測試接口響應時間,奈何命令行參數太多,記不住怎么辦?這時候你需要個男人,它就是 man。

經常使用命令行,比如 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 來安裝。

tldr

  1. [root@VM_0_14_centos ~]# npm install -g tldr 
  2. /usr/local/n/versions/node/11.4.0/bin/tldr -> /usr/local/n/versions/node/11.4.0/lib/node_modules/tldr/bin/tldr 
  3. + tldr@3.2.7 
  4. added 113 packages from 103 contributors in 60.759s 
  5.  
  6.  
  7.    ╭───────────────────────────────────────────────────────────────╮ 
  8.    │                                                               │ 
  9.    │       New minor version of npm available! 6.4.1 → 6.9.0       │ 
  10.    │   Changelog: https://github.com/npm/cli/releases/tag/v6.9.0   │ 
  11.    │               Run npm install -g npm to update!               │ 
  12.    │                                                               │ 
  13.    ╰───────────────────────────────────────────────────────────────╯ 

安裝完后先看看 tldr 自己怎么用吧。

  1. $ tldr tldr 
  2.  
  3.   tldr 
  4.  
  5.   Simplified man pages. 
  6.   More information: . 
  7.  
  8.   - Get typical usages of a command (hint: this is how you got here!): 
  9.     tldr command 
  10.  
  11.   - Show the tar tldr page for linux: 
  12.     tldr -p linux tar 
  13.  
  14.   - Get help for a git subcommand: 
  15.     tldr git checkout 

小試牛刀下

  1. $ tldr -p linux tar 
  2.  
  3.   tar 
  4.  
  5.   Archiving utility. 
  6.   Often combined with a compression method, such as gzip or bzip. 
  7.   More information: . 
  8.  
  9.   - Create an archive from files: 
  10.     tar -cf target.tar file1 file2 file3 
  11.  
  12.   - Create a gzipped archive: 
  13.     tar -czf target.tar.gz file1 file2 file3 
  14.  
  15.   - Extract an archive in a target directory: 
  16.     tar -xf source.tar -C directory 
  17.  
  18.   - Extract a gzipped archive in the current directory: 
  19.     tar -xzf source.tar.gz 
  20.  
  21.   - Extract a bzipped archive in the current directory: 
  22.     tar -xjf source.tar.bz2 
  23.  
  24.   - Create a compressed archive, using archive suffix to determine the compression program: 
  25.     tar -caf target.tar.xz file1 file2 file3 
  26.  
  27.   - List the contents of a tar file: 
  28.     tar -tvf source.tar 
  29.  
  30.   - Extract files matching a pattern: 
  31.     tar -xf source.tar --wildcards "*.html" 

嗯,很簡潔,直接給出了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安裝。

如果你不想安裝tldr,也可以直接使用網頁在線查看https://tldr.sh/

 

 

 

有了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

cht.sh

  1. [root@VM_0_14_centos ~]# curl cht.sh/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 follow redirects 
  15. curl -L http://example.com/file 
  16.  
  17. # Download a file and pass HTTP Authentication 
  18. curl -u username:password URL 
  19.  
  20. # Download a file with a Proxy 
  21. curl -x proxysever.server.com:PORT http://addressiwantto.access 
  22.  
  23. # Download a file from FTP 
  24. curl -u username:password -O ftp://example.com/pub/file.zip 
  25.  
  26. # Get an FTP directory listing 
  27. curl ftp://username:password@example.com 
  28.  
  29. # Resume a previously failed download 
  30. curl -C - -o partial_file.zip http://example.com/file.zip 
  31.  
  32. Fetch only the HTTP headers from a response 
  33. curl -I http://example.com 
  34.  
  35. Fetch your external IP and network info as JSON 
  36. curl http://ifconfig.me/all/json 
  37.  
  38. # Limit the rate of a download 
  39. curl --limit-rate 1000B -O http://path.to.the/file 
  40.  
  41. # POST to a form 
  42. curl -F "name=user" -F "password=test" http://example.com 
  43.  
  44. # POST JSON Data 
  45. curl -H "Content-Type: application/json" -X POST -d '{"user":"bob","pass":"123"}' http://example.com 
  46.  
  47. # POST data from the standard in / share data on sprunge.us 
  48. curl -F 'sprunge=<-' sprunge.us 

看看Python的requests怎么用

  1. [root@VM_0_14_centos ~]# curl cheat.sh/python/requests 
  2. #  python-requests: Limit Number of Redirects Followed 
  3. #  You have to create Session (http://www.python- 
  4. #  requests.org/en/latest/api/requests.Session) object and set 
  5. #  max_redirects variable to 3 
  6.  
  7. session = requests.Session() 
  8. session.max_redirects = 3 
  9. session.get(url) 
  10.  
  11. #  TooManyRedirects exception will be raised if a requests exceeds 
  12. #  maximum number of redirects. 
  13. #  Related github issue discussing why you can not set max_redirects per 
  14. #  request https://github.com/kennethreitz/requests/issues/1300 
  15. #  [Alik] [so/q/31552627] [cc by-sa 3.0] 

它也有網頁版 http://cht.sh/curl

 

 

 

 

有了tldr和cheat,再也不用記那么多命令行參數了。

win下執行命令行的工具我常用cmder,如果你用的win10,可以嘗試下微軟最新發布的Terminal https://github.com/microsoft/Terminal 

責任編輯:龐桂玉 來源: Linux學習
相關推薦

2025-08-05 07:52:41

man 命令Linux命令行

2024-09-29 13:25:56

2020-12-11 06:44:16

命令行工具開發

2020-12-10 16:16:08

工具代碼開發

2011-01-18 19:11:26

Postfix命令行

2023-06-09 07:45:29

Kuberneteskubectl

2013-11-15 09:43:15

JDK工具

2013-12-09 14:29:13

OpenStack命令行工具API

2010-11-24 17:12:17

MySQL命令行

2017-06-15 10:32:56

OracleDBV命令行工具

2018-04-03 13:50:27

Linux容器命令行工具

2010-02-04 15:17:48

Linux wget

2015-07-01 09:15:46

linuxQuora命令行

2018-05-04 09:15:35

PythonPlumbum命令行

2019-08-27 10:32:01

Linux操作系統Windows

2013-05-21 14:58:08

系統監視glances開源

2023-12-01 07:06:14

Go命令行性能

2011-06-17 16:49:05

Cocoa蘋果

2018-11-08 14:50:14

2015-07-30 11:24:47

Linux 系統命令行工具
點贊
收藏

51CTO技術棧公眾號

里番在线观看网站| 久久久一本精品99久久精品| 91九色丨porny丨国产jk| 黑人操亚洲人| 欧美人动与zoxxxx乱| 99热这里只有精品7| caoporn成人| 欧美日韩一区二区在线视频| 今天免费高清在线观看国语| 99久久视频| 视频直播国产精品| 伊人影院在线视频| 亚洲国产欧美另类丝袜| 夜夜添无码一区二区三区| 欧美性色综合| 国产福利精品av综合导导航| 成人免费一区| 亚洲欧美国产精品久久久久久久| 污污软件在线观看| 亚洲国产一二三| 国产精品少妇在线视频| 国产成人免费网站| 国产精品精品一区二区三区午夜版 | 97超碰人人看人人| 国产成人在线中文字幕| 欧美精品九九久久| av资源在线播放| 精品久久久久久久久久久院品网| 18视频在线观看网站| 色成年激情久久综合| 欧洲综合视频| 国产精品美女一区二区| 色播五月综合| 99国产精品久久久久久久久久久| 免费cad大片在线观看| 日本中文在线一区| 国产精品一区二区久久国产| 偷偷www综合久久久久久久| 国产一区二区三区丝袜| 日日夜夜亚洲| 国产成人+综合亚洲+天堂| **精品中文字幕一区二区三区| 久久深夜福利免费观看| 国产午夜久久av| 欧美在线中文字幕| 美女av一区| 日韩精品在在线一区二区中文 | 亚洲国产欧美国产综合一区| 欧美一级高清片| 免费看av不卡| 国产精品av免费在线观看| 99伊人成综合| 成人综合视频在线| 福利精品视频在线| 最新日韩一区| 国产精自产拍久久久久久蜜 | 日韩女优在线播放| 日韩国产精品久久| 成人免费淫片在线费观看| 色妞www精品视频| 91成人精品在线| 黄频视频在线观看| 欧美手机在线视频| 久久成人福利| 精品久久久久久无码中文野结衣| 亚洲成人动漫av| 免费a级人成a大片在线观看| 久久综合久久美利坚合众国| 在线播放精品| 婷婷国产在线| 日本视频久久久| 成人涩涩免费视频| 色帝国亚洲欧美在线| 亚洲a中文字幕| 国产精品麻豆网站| 日本小视频在线免费观看| www.成人av| 色婷婷一区二区| 美国成人xxx| 欧美在线激情| 精品久久久久香蕉网| 精品国产一区二区三区| 屁屁影院在线观看| 亚洲大胆人体在线| 视频一区在线播放| 动漫一区在线| 干日本少妇视频| 欧美性大战久久久久久久| 韩国精品一区| 国产欧美日韩网站| 亚洲第一福利一区| 国产午夜久久| 五月婷婷丁香色| 国产精品视频在线观看| 国产91精品精华液一区二区三区 | 欧美军人男男激情gay| 免费高清成人| 777午夜精品福利在线观看| 成人性生交大片免费| wwww亚洲| 国产精品theporn88| 欧美一区二区在线不卡| 在线播放日韩| 97久久网站| 在线精品日韩| 久久伊人精品视频| 日韩欧美高清视频| 国产一区二区三区网| 又黄又爽在线观看| 女女同性女同一区二区三区91| 日韩一区二区三区免费观看| 国产成人在线电影| 国产成人77亚洲精品www| 羞羞网站在线观看入口免费| 91精品国产777在线观看| 欧美日韩在线免费| 亚洲一区欧美二区| 亚洲欧洲二区| 先锋av资源在线| www.日本在线播放| 国产成人女人毛片视频在线| 日韩成人在线电影网| 有坂深雪av一区二区精品| 奇米影视在线99精品| 四虎影视精品| 中老年在线免费视频| 最新天堂中文在线| 色婷婷精品国产一区二区三区| 亚洲人av在线影院| 亚洲成人黄色影院| 丝袜美腿亚洲色图| 97蜜桃久久| 爱久久·www| 欧妇女乱妇女乱视频| 国产一区二区三区四区五区在线| 欧美老女人性视频| 日韩欧美一二三四区| 美国十次了思思久久精品导航| 国产黄色片在线播放| 久久久精品在线视频| 亚洲欧洲一二三| 51成人做爰www免费看网站| 庆余年2免费日韩剧观看大牛| 一区二区成人精品| 一区二区三区高清国产| 亚洲电影免费观看高清完整版在线| 亚洲妇女屁股眼交7| 一区二区三区不卡在线观看| 亚洲精品高清视频在线观看| 国产亚洲一本大道中文在线| 国产福利91精品| 成人午夜精品在线| 91丨九色丨尤物| 91蝌蚪porny九色| 亚洲欧美日本免费| 永久免费网站视频在线观看| 日韩欧美区一区二| 99国产一区二区三精品乱码| 51亚洲精品| 在线日本中文字幕| 欧美日韩国产综合一区二区| 欧美精品91| 国内毛片久久| 50度灰在线| 一级毛片免费在线| 区一区二日本| 伊大人久久香线焦宗合一75大| 午夜dv内射一区二区| chinese少妇国语对白| www国产免费| 亚洲欧美日韩国产yyy | 国产伦精品一区| 国产精品久久久久久久av电影| 亚洲人成网站色ww在线| 亚洲欧美中文在线视频| 亚洲欧美日韩天堂| 久久久精品久久| 午夜剧场成人观在线视频免费观看| 亚洲天堂男人天堂| 国产一区二区三区视频在线观看| 欧美成人官网二区| 亚洲无线码在线一区观看| 久久久女人电视剧免费播放下载| 久久成人一区二区| 日本久久久久亚洲中字幕| 国产美女搞久久| 成人自拍性视频| 成人精品久久av网站| 大片在线观看网站免费收看| 国产va亚洲va在线va| 亚洲色图 在线视频| 一级毛片免费观看| 国产日产一区二区三区| 岛国成人av| 91在线三级| 久久av影院| 色综合色综合| 日韩激情一二三区| 一区二区三区不卡视频在线观看| 亚洲成人av中文字幕|