翻译进度
2
分块数量
0
参与人数

Linux Shell 脚本:编写帮助文档

这是一篇协同翻译的文章,你可以点击『我来翻译』按钮来参与翻译。


All the Unix commands come with a number of optional and mandatory options. It is very common to forget the complete syntax of these commands.

Because no one can possibly remember every Unix command and all its options, we have online help available to mitigate this right from when Unix was at its development stage.

Unix's version of Help files are called man pages. If there is a command name and you are not sure how to use it, then Man Pages help you out with every step.

Syntax

Here is the simple command that helps you get the detail of any Unix command while working with the system −

$man command

Example

Suppose there is a command that requires you to get help; assume that you want to know about pwd then you simply need to use the following command −

$man pwd

The above command helps you with the complete information about the pwd command. Try it yourself at your command prompt to get more detail.

You can get complete detail on man command itself using the following command −

$man man

Man Page Sections

Man pages are generally divided into sections, which generally vary by the man page author's preference. Following table lists some common sections −

Section Description
NAME Name of the command
SYNOPSIS General usage parameters of the command
DESCRIPTION Describes what the command does
OPTIONS Describes all the arguments or options to the command
SEE ALSO Lists other commands that are directly related to the command in the man page or closely resemble its functionality
BUGS Explains any known issues or bugs that exist with the command or its output
EXAMPLES Common usage examples that give the reader an idea of how the command can be used
AUTHORS The author of the man page/command

To sum it up, man pages are a vital resource and the first avenue of research when you need information about commands or files in a Unix system.

Useful Shell Commands

The following link gives you a list of the most important and very frequently used Unix Shell commands.

If you do not know how to use any command, then use man page to get complete detail about the command.

本文章首发在 LearnKu.com 网站上。

本文中的所有译文仅用于学习和交流目的,转载请务必注明文章译者、出处、和本文链接
我们的翻译工作遵照 CC 协议,如果我们的工作有侵犯到您的权益,请及时联系我们。

原文地址:

译文地址:https://learnku.com/server/wikis/36673

讨论数量: 0
(= ̄ω ̄=)··· 暂无内容!

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!