linux命令之whatis

来源:百度文库 编辑:神马文学网 时间:2024/04/29 05:16:50
最有用的命令之一是那些提供帮助的命令(特别是对那些学习 Linux 的人而言)。Linux 中的两个重要的信息来源是联机参考手册,或 man 页面和 whatis 工具。您可以用 whatis 命令来访问一个不熟悉的命令的 man 页面。  $ whatis echo

要了解关于这个命令的更多信息,可以使用:

 $ man  echo

 如果您不知道某个特殊任务所需的命令,您可以用 man -k (也称为 apropos)和一个主题来生成可能的命令。例如:

 

$ man -k files

 一个很有用但常常被忽视的命令可以提供关于使用 man 本身的信息:

 $ man man

 您可以用 SPACEBAR 来浏览任意的 man 页面;UP ARROW 将向上翻滚文件。.要退出,则输入 q,!,或 CTRL-Z。

通过makewahtis建立wathis所需数据库

[root@server1 ~]# whatis ls
ls                   (1)  - list directory contents
ls                   (1p)  - list directory contents
[root@server1 ~]# whatis cat
cat                  (1)  - concatenate files and print on the standard output
cat                  (1p)  - concatenate and print files

里面的1和1p是section
常见的包括

Sections of the Manual Pages
The manual Sections are traditionally defined as follows:
1 Commands (Programs)
Those commands that can be executed by the user from within a shell.
2 System calls
Those functions which must be performed by the kernel.
3 Library calls
Most of the libc functions.
4 Special files (devices)
Files found in /dev.
5 File formats and conventions
The format for /etc/passwd and other human-readable files.
6 Games
7 Conventions and miscellaneous
Overviews of various topics, conventions and protocols, character set standards, and miscellaneous other things.
8 System management commands
Commands like mount(8), many of which only root can execute.

此外:
man-pages currently includes pages from the POSIX.1 standard in Section 0p (Header Files), 1p (Commands), and 3p (Functions).