Man 及获取帮助

command --help and man command are the two most important tools at the command line.

Virtually all commands understand the -h (or --help) option which will produce a short usage description of the command and its options, then exit back to the command prompt. Type:

man -h

or

man --help

to see this in action.

Every command and nearly every application in Linux has a man (manual) file. It is as simple as typing man command to bring up a longer manual entry for the specified command. For example:

man mv

brings up the mv manual.

使用箭头键在 man 文件中上下移动,用 q 键退回到命令提示符。

man man

brings up the manual entry for the man command, which is a good place to start.

man intro

is especially useful. It displays the introduction to user commands which is a well-written, brief introduction to the Linux command line.

There are also info pages, which generally go into more detail than man pages. Try:

info info

for the introduction to info pages.

搜索 man 手册文件

如果您不确定要用什么命令或应用程序,可以搜索 man 文件。

To search the man files for konsole, try:

man -k konsole

Note

这和 apropos 命令是一样的。

To search only the titles of your system's man files, try:

man -f kde

Note

这和 whatis 命令是一样的。