我刚刚发现了 whatis 并想将信息添加到我的 bash 脚本中。
将信息添加到 bash 脚本中的最佳方法是什么
whatis
去接?
最佳答案
whatis
从 whatis 数据库 中获取所有信息,这些信息是使用命令 makewhatis
生成的。
有两种方法可以将条目添加到数据库中。
- 为您的程序或脚本创建并安装手册页,然后运行
makewhatis
。 - 手动编辑whatis 数据库。(不建议)
makewhatis
从命令手册页的 NAME 部分选取第一行。
whatis 数据库 在我的机器上的位置是 /usr/share/man/whatis
,这是它的样子..
ABORT(7) - abort the current transaction
ALTER_AGGREGATE(7) - change the definition of an aggregate function
ALTER_COLLATION(7) - change the definition of a collation
ALTER_CONVERSION(7) - change the definition of a conversion
...
ping(8) - send ICMP ECHO_REQUEST packets to network hosts
...
这是 man ping
NAME
ping -- send ICMP ECHO_REQUEST packets to network hosts
SYNOPSIS
ping [-AaCDdfnoQqRrv] [-b boundif] [-c count] [-G sweepmaxsize]
关于linux - 将 whatis Hook 添加到 bash 脚本中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17266476/