Linux 上安装 cheat 命令的过程
环境1:腾讯云上ubuntu 24.04 虚拟主机
- # cheat ps //系统反馈:bash: cheat: command not found
- #apt-get install cheat //系统反馈:E: Unable to locate package cheat
- #apt update //系统反馈:274 packages can be upgraded. Run 'apt list --upgradable' to see them.
- #apt apt install python3-pip //系统反馈:python3-pip is already the newest version (24.0+dfsg-1ubuntu1.3).
- #pip3 install cheat //系统反馈:error: externally-managed-environment
- #pip3 install cheat --break-system-packages //系统反馈:Successfully installed cheat-2.5.1 docopt-0.6.2 termcolor-3.3.0
- #cheat ps //系统反馈:No cheatsheet found for ps
- #git clone https://github.com/cheat/cheatsheets.git ~/.config/cheat/cheatsheets/community //系统反馈:Receiving objects: 100% (2058/2058), 476.47 KiB | 16.43 MiB/s, done.
- #cheat ps //系统反馈:No cheatsheet found for ps
- #mkdir /usr/share/cheat
- #cd /usr/share/cheat
- #cp ~/.config/cheat/cheatsheets/community/* .
- #cheat ps //successful
# To list every process on the system: ps aux # To list a process tree: ps axjf # To list every process owned by foouser: ps -aufoouser # To list every process with a user-defined format: ps -eo pid,user,command # Exclude grep from your grepped output of ps. # Add [] to the first letter. Ex: sshd -> [s]shd ps aux | grep '[h]ttpd'
环境2:火山云上CentOS Stream 9 虚拟主机
- #dnf install cheat //系统反馈:Error: Unable to find a match: cheat
- #dnf install epel-release //系统反馈:Nothing to do.
- #dnf install python3-pip //系统反馈:Nothing to do.
- #pip3 install cheat //系统反馈:Requirement already satisfied:
- #cheat ps //命令成功执行,反馈如下:
[root@iv-ye4b22hxxcxjd1tj3rwb cjl]# cheat ps # To list every process on the system: ps aux # To list a process tree ps axjf # To list every process owned by foouser: ps -aufoouser # To list every process with a user-defined format: ps -eo pid,user,command # Exclude grep from your grepped output of ps. # Add [] to the first letter. Ex: sshd -> [s]shd ps aux | grep '[h]ttpd'
浙公网安备 33010602011771号