Linux线上查询及帮助命令

来源:互联网 发布:windows音量控制程序 编辑:程序博客网 时间:2024/05/16 14:40

man命令

man命令是Linux下的帮助指令,通过man指令可以查看Linux中的指令帮助、配置文件帮助和编程帮助等信息。

语法

man(选项)(参数) 

选项

-a:在所有的man帮助手册中搜索; -f:等价于whatis指令,显示给定关键字的简短描述信息; -P:指定内容时使用分页程序; -M:指定man手册搜索的路径。

参数

  • 数字:指定从哪本man手册中搜索帮助;
  • 关键字:指定要搜索帮助的关键字。

Linux的man手册共有以下几个章节:

1、Standard commands (标准命令)2、System calls (系统调用)3、Library functions (库函数)4、Special devices (设备说明)5、File formats (文件格式)6、Games and toys (游戏和娱乐)7、Miscellaneous (杂项)8、Administrative Commands (管理员命令)9 其他(Linux特定的), 用来存放内核例行程序的文档。

实例

    man ls         man 3 sleep

help命令

help命令用于显示shell内部命令的帮助信息。help命令只能显示shell内部的命令帮助信息。而对于外部命令的帮助信息只能使用man或者info命令查看。

语法

help(选项)(参数) 

选项

-s:输出短格式的帮助信息。仅包括命令格式。 

参数

内部命令:指定需要显示帮助信息的shell内部命令。 

实例

使用help命令显示shell内部shopt命令的帮助信息,输入如下命令:

help shopt            #获取shopt命令的帮助信息 

返回如下信息:

shopt: shopt [-pqsu] [-o] [optname ...]    Set and unset shell options.    Change the setting of each shell option OPTNAME.  Without any option    arguments, list all shell options with an indication of whether or not each    is set.    Options:      -o        restrict OPTNAMEs to those defined for use with `set -o'      -p        print each shell option with an indication of its status      -q        suppress output      -s        enable (set) each OPTNAME      -u        disable (unset) each OPTNAME    Exit Status:    Returns success if OPTNAME is enabled; fails if an invalid option is    given or OPTNAME is disabled.
原创粉丝点击