自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

Cheat : 一個(gè)實(shí)用Linux命令示例集合

系統(tǒng) Linux
我們中的許多人經(jīng)常查看 man 頁面 來了解命令開關(guān)(選項(xiàng)),它會(huì)顯示有關(guān)命令語法、說明、細(xì)節(jié)和可用的選項(xiàng),但它沒有任何實(shí)際的例子。因此,在組合成一個(gè)我們需要的完整命令時(shí)會(huì)遇到一些麻煩。你確實(shí)遇到這個(gè)麻煩而想要一個(gè)更好的解決方案嗎?我會(huì)建議你試一下 cheat。

 

[[215626]]

我們中的許多人經(jīng)常查看 man 頁面 來了解命令開關(guān)(選項(xiàng)),它會(huì)顯示有關(guān)命令語法、說明、細(xì)節(jié)和可用的選項(xiàng),但它沒有任何實(shí)際的例子。因此,在組合成一個(gè)我們需要的完整命令時(shí)會(huì)遇到一些麻煩。

你確實(shí)遇到這個(gè)麻煩而想要一個(gè)更好的解決方案嗎?我會(huì)建議你試一下 cheat。

 

Cheat 是什么

cheat 允許你在命令行中創(chuàng)建和查看交互式的速查表cheatsheet。它旨在幫助提醒 *nix 系統(tǒng)管理員他們經(jīng)常使用但還沒頻繁到會(huì)記住的命令的選項(xiàng)。

 

如何安裝 Cheat

cheat 是使用 python 開發(fā)的,所以可以用 pip 來在你的系統(tǒng)上安裝 cheat。

pip 是一個(gè)與 setuptools 捆綁在一起的 Python 模塊,它是在 Linux 中安裝 Python 包推薦的工具之一。

對(duì)于 Debian/Ubuntu 用戶,請(qǐng)使用 apt-get 命令apt 命令來安裝 pip。

  1. [對(duì)于 Python2]
  2. $ sudo apt install python-pip python-setuptools
  3. [對(duì)于 Python3]
  4. $ sudo apt install python3-pip

RHEL/CentOS 官方倉庫中沒有 pip,因此使用 EPEL 倉庫,并使用 YUM 命令安裝 pip

  1. $ sudo yum install python-pip python-devel python-setuptools

對(duì)于 Fedora 系統(tǒng),使用 dnf 命令來安裝 pip。

  1. [對(duì)于 Python2]
  2. $ sudo dnf install python-pip
  3. [對(duì)于 Python3]
  4. $ sudo dnf install python3

對(duì)于基于 Arch Linux 的系統(tǒng),請(qǐng)使用 Pacman 命令 來安裝 pip。

  1. [對(duì)于 Python2]
  2. $ sudo pacman -S python2-pip python-setuptools
  3. [對(duì)于 Python3]
  4. $ sudo pacman -S python-pip python3-setuptools

對(duì)于 openSUSE 系統(tǒng),使用 Zypper 命令來安裝 pip。

  1. [對(duì)于 Python2]
  2. $ sudo pacman -S python-pip
  3. [對(duì)于 Python3]
  4. $ sudo pacman -S python3-pip

pip 來在你的系統(tǒng)上安裝 cheat

  1. $ sudo pip install cheat

 

如何使用 Cheat

運(yùn)行 cheat,然后按相應(yīng)的命令來查看速查表,作為例子,我們要來看下 tar 命令的例子。

  1. $ cheat tar
  2. # To extract an uncompressed archive:
  3. tar -xvf /path/to/foo.tar
  4.  
  5. # To create an uncompressed archive:
  6. tar -cvf /path/to/foo.tar /path/to/foo/
  7.  
  8. # To extract a .gz archive:
  9. tar -xzvf /path/to/foo.tgz
  10.  
  11. # To create a .gz archive:
  12. tar -czvf /path/to/foo.tgz /path/to/foo/
  13.  
  14. # To list the content of an .gz archive:
  15. tar -ztvf /path/to/foo.tgz
  16.  
  17. # To extract a .bz2 archive:
  18. tar -xjvf /path/to/foo.tgz
  19.  
  20. # To create a .bz2 archive:
  21. tar -cjvf /path/to/foo.tgz /path/to/foo/
  22.  
  23. # To extract a .tar in specified Directory:
  24. tar -xvf /path/to/foo.tar -C /path/to/destination/
  25.  
  26. # To list the content of an .bz2 archive:
  27. tar -jtvf /path/to/foo.tgz
  28.  
  29. # To create a .gz archive and exclude all jpg,gif,... from the tgz
  30. tar czvf /path/to/foo.tgz --exclude=\*.{jpg,gif,png,wmv,flv,tar.gz,zip} /path/to/foo/
  31.  
  32. # To use parallel (multi-threaded) implementation of compression algorithms:
  33. tar -z ... -> tar -Ipigz ...
  34. tar -j ... -> tar -Ipbzip2 ...
  35. tar -J ... -> tar -Ipixz ...
  36.  

運(yùn)行下面的命令查看可用的速查表。

  1. $ cheat -l

進(jìn)入幫助頁面獲取更多詳細(xì)信息。

  1. $ cheat -h 
責(zé)任編輯:龐桂玉 來源: Linux中國
相關(guān)推薦

2013-10-08 15:51:03

Linux find命

2013-05-23 15:10:34

Netcat

2016-09-27 13:12:14

tar命令示例 Unix

2018-08-06 08:51:32

Linux命令cut

2015-10-29 13:10:08

passwd命令Linux

2014-09-10 11:23:31

Linux

2019-02-12 11:22:29

Linux 系統(tǒng) 命令

2021-04-11 10:08:50

LinuxLinux命令ntpdate

2021-04-13 10:25:57

Linux命令pstree

2015-10-14 10:45:04

linux命令less

2009-07-31 18:33:47

linux vi命令linux vi命令詳快捷鍵

2015-10-22 09:26:20

linux命令whereis命令

2017-12-27 10:20:01

Linux ls命令實(shí)用范例

2017-12-27 09:40:32

Linuxfind命令

2014-03-17 17:27:51

Linux mvLinux 命令

2013-10-08 16:24:34

Linux find命

2020-09-29 07:18:24

Linuxtee命令

2014-03-10 11:43:45

Linux終端命令

2023-11-06 18:02:28

Linux實(shí)用命令

2014-03-18 14:00:19

Linux監(jiān)控命令
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)