天天看点

Linux命令之帮助命令

1、man

功能:在线帮助

用法:man [命令]

1)man命令的可用帮助文档分类有

代码

代表内容

1

普通的命令

2

内核调用命令的函数与工具

3

常见的函数与函数库

4

设备文件的说明

5

配置文件

6

游戏

7

惯例与协议

8

管理员可用的命令

9

内核相关文件

2)帮助文档的目录结构

结构名称

代表意义

NAME

命令的名称

SYNOPSYS

参数的大致使用方法

DESCRIPTION

介绍说明

EXAMPLES

演示(附带简单说明)

OVERVIEW

概述

OEFAULTS

默认的功能

OPRIONS

具体的可用选项(带介绍)

ENVIRONMENT

环境变量

FILES

用到的文件

SEEALSO

相关的资料

HISTORY

维护历史与联系方式

3)man命令的操作按键

按键

用处

空格键

向下翻一页

[PageDown]

b

向上翻一页

[PageUp]

[HOME]

直接前往首页

[END]

直接前往尾页

/关键词

从上至下搜索某个关键词,如/Linux。

?关键词

从下上索某个关键词,如/Linux。

n

定位到下一个搜索到的关键词

N

定位到上一个搜索到的关键词

q

退出帮助文档

2、help    

功能:内置命令帮助

用法:help 内置命令

实例:

<code>[root@xuanwei ~]</code><code># help cd</code>

<code>cd</code><code>: </code><code>cd</code> <code>[-L|-P] [</code><code>dir</code><code>]</code>

<code>Change the shell working directory.</code>

<code>Change the current directory to DIR.  The default DIR is the value of the</code>

<code>HOME shell variable.</code>

<code>The variable CDPATH defines the search path </code><code>for</code> <code>the directory containing</code>

<code>DIR.  Alternative directory names </code><code>in</code> <code>CDPATH are separated by a colon (:).</code>

<code>A null directory name is the same as the current directory.  If DIR begins</code>

<code>with a slash (/), </code><code>then</code> <code>CDPATH is not used.</code>

3、--help

功能:一些命令自带的帮助参数,用来查看帮助

用法:命令 --help

<code>[root@backup ~]</code><code># ls --help</code>

<code>用法:</code><code>ls</code> <code>[选项]... [文件]...</code>

<code>列出 FILE 的信息(默认为当前目录)。</code>

<code>如果不指定-cftuvSUX 或--</code><code>sort</code> <code>选项,则根据字母大小排序。</code>

<code></code>

本文转自 炫维 51CTO博客,原文链接:http://blog.51cto.com/xuanwei/1889264

继续阅读