Man -f (1)は何の略ですか?

Man -f (1)は何の略ですか?

私は-f男性の旗を見ています。旗は次のように説明されています。

   -f, --whatis
          Equivalent to whatis.  Display a short description from the manual page, if available.  See whatis(1) for details.

実際に使用する-fエントリでは、常に最後に括弧が付き、複数のエントリが生成されることもあります。

結果の例man -f:

man -f grep:

grep (1)             - print lines matching a pattern

man -f man:

man (7)              - macros to format man pages
man (1)              - an interface to the on-line reference manuals

man -f git:

Git (3pm)            - Perl interface to the Git version control system
git (1)              - the stupid content tracker

通常のプログラムの説明はすべて で表示されると思います(1)

他にどのようなリストが検索されているのか、また括弧内のさまざまな数字の意味をどのように識別するのかを説明できる人はいますか?

man Git注: また、git では、 の代わりにを実行することで (3pm) のマニュアル ページを取得できることに気付きました。ではマニュアルは含まれますが、 では両方に関する情報が返されるのはman git直感に反しているようです。man gitgitGitman -f git

答え1

括弧内のもの(一部のシステムでは文字と数字の組み合わせになることもありますが、ほとんどの場合は1桁の数字です)は、マニュアルのセクション「マニュアル」とは、入手可能なマニュアルの総量を指します。

私の OpenBSD システムでは、これらのセクションはマニュアルman(1)(「コマンドのマニュアル」とも呼ばれman、 で読むことができますman man) に引用されています。

1         General commands (tools and utilities).
2         System calls and error numbers.
3         Library functions.
3p        perl(1) programmer's reference guide.
4         Device drivers.
5         File formats.
6         Games.
7         Miscellaneous information.
8         System maintenance and operation commands.
9         Kernel internals.

セクション番号はシステム間でほとんど同じですが、若干の差異がある場合があります。セクションは標準化されておらず、少なくとも POSIX では標準化されていないため、ほとんどが従来のものだと思います。

場合によっては、探しているセクションが何であるかを知っておく必要があります。printfたとえば、マニュアルの場合がそうです。 はシェルのユーティリティprintf(1)を指し、 はC ライブラリ ルーチンについて説明しています。 と入力すると、 が表示される可能性があります。C ライブラリ関数のマニュアルを取得するには、 を使用します。printfprintf(3)printf()man printfprintf(1)man 3 printf

これらのセクションは、1971 年にベル研究所から発表された UNIX の第 3 版 (アセンブリ言語ではなく C で書かれた最初の UNIX) で導入されたようです。

UNIX第3版のマニュアルには、以下のセクション:

I.    Commands
II.   System calls
III.  Subroutines
IV.   Special files
V.    File formats
VI.   User-maintained programs
VII.  Miscellaneous
VIII. Maintenance

答え2

抜粋man man(5段落目):

   1   Executable programs or shell commands
   2   System calls (functions provided by the kernel)
   3   Library calls (functions within program libraries)
   4   Special files (usually found in /dev)
   5   File formats and conventions eg /etc/passwd
   6   Games
   7   Miscellaneous (including macro packages and conventions), e.g. man(7), groff(7)
   8   System administration commands (usually only for root)
   9   Kernel routines [Non standard]

答え3

番号は、情報がマニュアルのどのセクションからのものかを示します (本来は、棚にあったマニュアル セットのどの物理ボリュームからのものかを示します)。

からman man

   The table below shows the section numbers of the manual followed by the  types  of
   pages they contain.

   1   Executable programs or shell commands
   2   System calls (functions provided by the kernel)
   3   Library calls (functions within program libraries)
   4   Special files (usually found in /dev)
   5   File formats and conventions eg /etc/passwd
   6   Games
   7   Miscellaneous   (including  macro  packages  and  conventions),  e.g.  man(7),
       groff(7)
   8   System administration commands (usually only for root)
   9   Kernel routines [Non standard]

いくつかの追加の「セクション」は後で追加されました。たとえば、(3pm)上記の引用テキストの は、perl モジュール (またはライブラリ) を参照しています。

答え4

コマンドの後の数字は、そのコマンドのドキュメントがマニュアル ページのどのセクションにあるかを示します。たとえば、grep(1) は、grep のマニュアル ページがマニュアル ページのセクション 1 にあることを意味します。

UNIX のさまざまな種類や Linux のさまざまなディストリビューションでは、どのコマンドのドキュメントをどのセクションに配置するかについての規則が異なります。

関連情報