文章目录
linux_supplement of man(manpages)/获取linux命令用法示例的若干辅助命令行工具/网站/linux_python/pip检查
references
- Good Alternatives To Man Pages Every Linux User Needs To Know (ostechnix.com)
- 简单的安装ruby:How to Install Ruby on Ubuntu 20.04 {Step-by-Step} (phoenixnap.com)
- Install Cheat Command on Ubuntu 20.04 - kifarunix.com
#安装bropages(gem&ruby based)
- #直接复制本section(#用于注释,勿删)
#ruby 环境安装
sudo apt install ruby-full
# 检查版本
ruby --version
#安装gem+bropages
# gem可以安装bropages
sudo apt install gem
#环境准备完毕,开始下载build bropages
sudo gem install bropages
使用
获取帮助
bro -h
查询某个命令
bro <commandName>
示例:bro top
┌─[cxxu@cxxuAli] - [~] - [2022-04-11 11:44:19]
└─[0] <> bro top
/var/lib/gems/2.5.0/gems/commander-4.1.5/lib/commander/user_interaction.rb:328: warning: constant ::NIL is deprecated
commander-4.1.5/lib/commander/user_interaction.rb:328: warning: constant ::Bignum is deprecated
4 entries for top -- submit your own example with "bro add top"
# order by memory
top -o %MEM
bro thanks to upvote (4)
bro ...no to downvote (0)
......................................................................................................................................................................................
# monitor the process with pid 1, 2, and 3
top -p 1, 2, 3
bro thanks 2 to upvote (5)
bro ...no 2 to downvote (2)
......................................................................................................................................................................................
# Run the top command once, and only show the header and first 8 processes
# Can be further parsed with '| awk ...' in various scripts
top -n 1 | head -n 15
bro thanks 3 to upvote (3)
bro ...no 3 to downvote (1)
cheat(python pip based)
检查pip3/python 可执行文件对应关系/别名
type pip3 pip py python3 python
┌─[cxxu@cxxuAli] - [~/.local/lib/python3.8/site-packages] - [2022-04-11 02:31:18]
└─[0] <> type pip3 pip py python3 python
pip3 is /usr/bin/pip3
pip is an alias for sudo py -m pip
py is /usr/bin/py
python3 is /usr/bin/python3
python is /usr/bin/python
检查pip版本
pip[3] -V
(大写的V选项)
┌─[cxxu@cxxuAli] - [~/.local/lib/python3.8/site-packages] - [2022-04-11 02:33:01]
└─[0] <> pip3 -V
pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6)
┌─[cxxu@cxxuAli] - [~/.local/lib/python3.8/site-packages] - [2022-04-11 02:33:07]
└─[0] <> pip -V
pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.8)
-
type pip3
-
sudo pip3 install cheat
-
版本检查:
cheat -v
-
获取帮助
cheat -h
pip/python软连接检查
type/whereis
可以用以查找python/pip路径ls -l
可以用来检查找到的路径是否为某个link
#( 04/11/22@ 3:30PM )( cxxu@cxxuAli ):~
type python
python is /usr/bin/python
#( 04/11/22@ 3:30PM )( cxxu@cxxuAli ):~
ls -l /usr/bin/python
lrwxrwxrwx 1 root root 9 Apr 5 17:52 /usr/bin/python -> python3.8
#( 04/11/22@ 3:31PM )( cxxu@cxxuAli ):~
cd /usr/bin
#( 04/11/22@ 3:31PM )( cxxu@cxxuAli ):/usr/bin
ls -l python
lrwxrwxrwx 1 root root 9 Apr 5 17:52 python -> python3.8
#( 04/11/22@ 3:31PM )( cxxu@cxxuAli ):/usr/bin
ls -l py
lrwxrwxrwx 1 root root 9 Apr 5 16:18 py -> python3.8
#( 04/11/22@ 3:31PM )( cxxu@cxxuAli ):/usr/bin
ls -l python3
lrwxrwxrwx 1 root root 9 Feb 8 14:51 python3 -> python3.6
更新pip版本
- 根据上述查看方式,选择合适的python版,执行
py -m pip install --upgrade pip
进行安装(py可以自行指定已安装的python版本)
更换安装来源(对于较新版本的pip)
- 较新版本支持 pip config
- 譬如更换为阿里源
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
pip问题排除
- 确保pip3安装且可用(
sudo apt install python3-pip
)
ltdr(nodejs based)
ltdr工具介绍
获取帮助
┌─[cxxu@cxxuAli] - [~] - [2022-04-11 02:08:13]
└─[0] <> tldr -h
- Usage: tldr command [options]
Simplified and community-driven man pages...
在线版tldr
安装一个本地版本
- 环境预备:安装/配置nodejs&npm
npm -g install ltdr
manly(python based)
- 解释您的命令所带的选项
┌─[cxxu@cxxuAli] - [~/.local/lib/python3.8/site-packages] - [2022-04-11 02:27:24]
└─[0] <> manly -h
usage: manly [-h] [-v] ...
Explain how FLAGS modify a COMMAND's behaviour.
positional arguments:
command
optional arguments:
-h, --help show this help message and exit
-v, --version display version information and exit.
# 例子
example:
$ manly rm --preserve-root -rf
rm - remove files or directories
================================
-f, --force
ignore nonexistent files and arguments, never prompt
--preserve-root
do not remove '/' (default)
-r, -R, --recursive
remove directories and their contents recursively