搜索time
命令的联机帮助页不会产生任何结果(搜索表格)。
作为旁注,它似乎是 BASH 内置命令,因为dpkg --search bin/time
找不到它。也许这样的命令没有自己的联机帮助页?
答案1
正确的,通常 shell 内置程序有help
页面,因为它们的使用通常不涉及。如果内置命令是如此复杂,可能会通过将该功能推入其自己的可执行文件来简化 shell 逻辑,此时它会获取手册页。
time
您可以使用以下方式获取信息help time
[jadavis6@ditirlns01 ~]$ help time
time: time [-p] PIPELINE
Execute PIPELINE and print a summary of the real time, user CPU time,
and system CPU time spent executing PIPELINE when it terminates.
The return status is the return status of PIPELINE. The `-p' option
prints the timing summary in a slightly different format. This uses
the value of the TIMEFORMAT variable as the output format.
times: times
Print the accumulated user and system times for processes run from
the shell.
由于您的示例是bash
,对于 GNU 工具,您可能还会尝试info <toolName>
获取更详尽的信息。help
被设计为在命令行上运行,他们不想淹没您的屏幕(可能将有用的信息推到屏幕之外),因此他们尝试保持help
简短并在信息页面中为您提供完整的信息。例如:
[jadavis6@hypervisor ~]$ info time
<...按下 Enter 后,会出现一个 ncurses 页面...>
File: time.info, Node: Top, Prev: (dir), Up: (dir)
This file documents the the GNU `time' command for running programs
and summarizing the system resources they use. This is edition 1.7,
for version 1.7.
* Menu:
* Resource Measurement:: Measuring program resource use.
-- The Detailed Node Listing --
Measuring Program Resource Use
* Setting Format:: Selecting the information reported by `time'.
* Format String:: The information `time' can report.
* Redirecting:: Writing the information to a file.
* Examples:: Examples of using `time'.
* Accuracy:: Limitations on the accuracy of `time' output.
* Invoking time:: Summary of the options to the `time' command.
The Format String
* Time Resources::
* Memory Resources::
* I/O Resources::
* Command Info::
完整描述信息页面可能超出了您的问题范围,因此我将其保留。我提到它只是为了让你知道它们的存在。
答案2
正确的。 Shell 内置函数包含在其 shell 的手册页中,因为不存在适合它们的离散手册部分。