Time

為什麼 Debian 沒有 time(1) 聯機幫助頁?

  • October 26, 2013

搜尋time命令的手冊頁不會產生任何結果(搜尋表單)。

作為旁注,它似乎是 BASH 內置命令,因為dpkg --search bin/time找不到它。也許這樣的命令沒有自己的聯機幫助頁?

正確,通常 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.

由於您的範例是bashGNU 工具,您還可以嘗試info <toolName>獲取更詳盡的資訊。help設計為在命令行上執行,並且他們不想淹沒您的螢幕(可能會將有用的資訊推送到螢幕外),因此他們會盡量保持help簡短並在資訊頁面中為您提供完整的資訊。例如:

[jadavis6@hypervisor ~]$ info time

<…按輸入鍵後,會出現一個 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::

完全描述資訊頁面可能超出了您的問題範圍,所以我將保留它。我只是提到它,以便您知道它們的存在。

引用自:https://unix.stackexchange.com/questions/97661