一個比man、help更好的命令協助軟體。

來源:互聯網
上載者:User

標籤:協助文檔   cheat

實驗環境:

vmware workstation 11

centos6.7的系統下  

ip:192.168.244.129   防火牆關閉 setenforce 0

putty(ssh遠端連線軟體)



軟體介紹:

什麼是cheat?

cheat是在GNU通用公用許可證下,為Linux命令列使用者發行的互動式備忘單應用程式。它提供顯示Linux命令使用案例,包括該命令所有的選項和簡短但尚可理解的功能。




實驗過程:

‘Cheat’有兩個主要的依賴——‘python’ 和 ‘pip’,在安裝‘cheat’之前,確保你的系統安裝了python和pip。

一、安裝pip

[[email protected] ~]#  yum install python-pip -y


二、安裝cheat

[[email protected] ~]# pip install  cheatCollecting cheat/usr/lib/python2.6/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.  InsecurePlatformWarning  Downloading cheat-2.1.25.tar.gz (43kB)    100% |████████████████████████████████| 45kB 111kB/sCollecting docopt>=0.6.1 (from cheat)  Downloading docopt-0.6.2.tar.gzCollecting pygments>=1.6.0 (from cheat)  Downloading Pygments-2.1.3-py2.py3-none-any.whl (755kB)    100% |████████████████████████████████| 757kB 172kB/sInstalling collected packages: docopt, pygments, cheat  Running setup.py install for docopt  Running setup.py install for cheatSuccessfully installed cheat-2.1.25 docopt-0.6.2 pygments-2.1.3

三、軟體的使用方法

[[email protected] ~]# cheat tcpdump# TCPDump is a packet analyzer. It allows the user to intercept and display TCP/IP# and other packets being transmitted or received over a network. (cf Wikipedia).# Note: 173.194.40.120 => google.com# Intercepts all packets on eth0tcpdump -i eth0# Intercepts all packets from/to 173.194.40.120tcpdump host 173.194.40.120# Intercepts all packets on all interfaces from / to 173.194.40.120 port 80# -nn => Disables name resolution for IP addresses and port numbers.tcpdump -nn -i any host 173.194.40.120 and port 80# Make a grep on tcpdump (ASCII)# -A  => Show only ASCII in packets.# -s0 => By default, tcpdump only captures 68 bytes.tcpdump -i -A any host 173.194.40.120 and port 80 | grep ‘User-Agent‘# With ngrep# -d eth0 => To force eth0 (else ngrep work on all interfaces)# -s0 => force ngrep to look at the entire packet. (Default snaplen: 65536 bytes)ngrep ‘User-Agent‘ host 173.194.40.120 and port 80# Intercepts all packets on all interfaces from / to 8.8.8.8 or 173.194.40.127 on port 80tcpdump ‘host ( 8.8.8.8 or 173.194.40.127 ) and port 80‘ -i any# Intercepts all packets SYN and FIN of each TCP session.tcpdump ‘tcp[tcpflags] & (tcp-syn|tcp-fin) != 0‘# To display SYN and FIN packets of each TCP session to a host that is not on our networktcpdump ‘tcp[tcpflags] & (tcp-syn|tcp-fin) != 0 and not src and dst net local_addr‘# To display all IPv4 HTTP packets that come or arrive on port 80 and that contain only data (no SYN, FIN no, no packet containing an ACK)tcpdump ‘tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)‘# Saving captured datatcpdump -w file.cap# Reading from capture filetcpdump -r file.cap# Show content in hexa# Change -x to -xx => show extra header (ethernet).tcpdump -x# Show content in hexa and ASCII# Change -X to -XX => show extra header (ethernet).tcpdump -X# Note on packet maching:# Port matching:# - portrange 22-23# - not port 22# - port ssh# - dst port 22# - src port 22## Host matching:# - dst host 8.8.8.8# - not dst host 8.8.8.8# - src net 67.207.148.0 mask 255.255.255.0# - src net 67.207.148.0/24

可以看到輸出簡單易懂,用法清晰明了。


參考文章連結:http://os.51cto.com/art/201409/450709.htm


本文出自 “積少成多” 部落格,謝絕轉載!

一個比man、help更好的命令協助軟體。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.