0%

刚刚好合适的 apropos 命令

刚刚好合适的 apropos 命令

.. note::
旧时月色,算几番照我,梅边吹笛。
宋·姜夔《暗香》

apropos的中文含义就是恰好的、合适的,奈何这个单词或者命令确实不好记,当然是可以扩充词汇量的。

什么时候会用到这个命令呢,先看看这个命令的定义。

apropos 命令的官方定义为:

search the manual page names and descriptions

意思很明显,如果我不记得命令或者不知道该用什么命令的时候,可以通过关键词来索引查找这些命令,比如我们想用linux绘制图像,但是不知道什么命令,测试可以使用:

1
2
3
4
5
6
$ apropos plot

bno_plot (1) – generate interactive 3D plot of IO blocks and sizes
gnuplot (1) – an interactive plotting program
pbmtoplot (1) – convert a PBM image into a Unix 'plot' file

或许每个人的输出不同,这个主要取决于安装的软件包和索引的数据库。以上。

再来一个实例,这个应该大部分的都类似:

1
2
3
4
5
6
7
8
9
10
11
12
$ apropos who

at.allow (5) - determine who can submit jobs via at or batch
at.deny (5) - determine who can submit jobs via at or batch
btrfs-filesystem (8) - command group of btrfs that usually work on the whole filesystem
docker-trust-signer (1) - Manage entities who can sign Docker images
ipsec_newhostkey (8) - generate a new raw RSA authentication key for a host
ipsec_showhostkey (8) - show host's authentication key
w (1) - Show who is logged on and what they are doing.
who (1) - show who is logged on
who (1p) - display who is on the system
whoami (1) - print effective userid

这个命令平时用的不多,跟whatis类似,因为这些功能都被加到了包罗万象的man命令。

处无为之事,行不言之教;作而弗始,生而弗有,为而弗恃,功成不居!

欢迎关注我的其它发布渠道