linux - 将 whatis Hook 添加到 bash 脚本中

标签 linux bash

我刚刚发现了 whatis 并想将信息添加到我的 bash 脚本中。

将信息添加到 bash 脚本中的最佳方法是什么

  whatis

去接?

最佳答案

whatiswhatis 数据库 中获取所有信息,这些信息是使用命令 makewhatis 生成的。

有两种方法可以将条目添加到数据库中。

  1. 为您的程序或脚本创建并安装手册页,然后运行makewhatis
  2. 手动编辑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/

相关文章:

linux - 需要从linux目录制作可启动SD卡

linux - `cp -dR ` 的问题

php - 长时间运行的 PHP 脚本在通过 exec() 调用时停止,但在通过 CLI 调用时结束

bash - 在内联运行命令中访问容器环境变量

bash - 如何暂时只在 bash 脚本中设置 PATH?

javascript - NodeJS - 逐行读取函数 + While 循环

linux - 为什么 echo 从不打印

regex - 如何获取包含\n的最后一行?

linux - for 循环中的星号无法按预期工作?

linux - 无法解释的平均负载 CentOS Linux php-fpm