Linux常用命令——帮助命令

1、帮助命令:man

man 命令
    获取指定命令的帮助

  

[dmtsai@study ~]$ man date 
DATE (1)                           User Commands DATE(1)
 #注意这个(1),代表的是man命令的帮助等级,也叫区段 
NAME   <==指令的完整全名,如下所示为date且说明简单用途为设定与显示日期/时间
       date - print or set the system date and time

SYNOPSIS   <==指令的基本语法如下所示 
       date [OPTION]... [+FORMAT]                             <==第一种单纯显示的用法 
       date [-u|--utc|--universal] [MMDDhhmm[[ CC]YY][.ss]]    <==这种可以设定系统时间的用法

DESCRIPTION   <==详细说明刚刚语法谈到的选项与参数的用法
       Display the current time in the given FORMAT, or set the system date.

       Mandatory arguments to long options are mandatory for short options too.

       -d, --date=STRING   <==左边-d为短选项名称,右边--date为完整选项名称
              display time described by STRING, not 'now'

       -f, --file=DATEFILE
              like --date once for each line of DATEFILE

       -I[TIMESPEC], --iso-8601[=TIMESPEC]
              output date/time in ISO 8601 format. TIMESPEC='date' for date only (the
              default), 'hours', 'minutes', 'seconds', or 'ns' for date and time to the
              indicated precision.
....(中间省略).... 
       #下方是格式化输出的详细资料
       FORMAT controls the output. Interpreted sequences are:

       %% a literal %

       %a locale's abbreviated weekday name (eg, Sun)

       %A locale's full weekday name (eg, Sunday)
....(中间省略).... 
ENVIRONMENT   <==与这个指令相关的环境参数有如下的说明
       TZ Specifies the timezone, unless overridden by command line parameters.  
              If neither is specified, the setting from /etc/localtime is used.

EXAMPLES      <==一堆可用的范本
       Convert seconds since the epoch (1970-01-01 UTC) to a date

              $ date --date='@2147483647'
....(中间省略)....

DATE STRING   <==上面曾提到的--date的格式说明!
       The --date=STRING is a mostly free format human readable date string such as "Sun, 29
       Feb 2004 16:21:42 -0800" or "2004-02-29 16:21:42" or even "next Thursday". A date
       string may contain items indicating calendar date, time of day, time zone, day of

AUTHOR   <==这个指令的作者啦!
       Written by David MacKenzie.

COPYRIGHT   <==受到著作权法的保护!用的就是GPL了!
       Copyright © 2013 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or
       later <http://gnu.org/licenses/gpl.html>.
       This is free software: you are free to change and redistribute it. There is NO WAR‐
       RANTY, to the extent permitted by law.

SEE ALSO   <==这个重要,你还可以从哪里查到与date相关的说明文件之意
       The full documentation for date is maintained as a Texinfo manual. If the info and
       date programs are properly installed at your site, the command

              info coreutils 'date invocation'

       should give you access to the complete manual.

GNU coreutils 8.22 June 2014 DATE(1)

  (上方代码来源:http://linux.vbird.org/linux_basic/0160startlinux.php

  man的帮助级

    区段1:用户指令,查看命令的帮助
    区段2:系统调用,查看可被内核调用的函数的帮助
    区段3:程序库调用,查看函数和函数库的帮助
    区段4:设备,查看特殊文件的帮助(主要是/dev目录下的文件)
    区段5:文件格式,查看配置文件的帮助
    区段6:游戏,查看游戏的帮助
    区段7:杂项,查看其它杂项的帮助
    区段8:系统指令,查看系统管理员可用的命令的帮助
    区段9:内核内部指令,查看内核相关文件的帮助
    区段n:Tcl或Tk指令

2、选项帮助--help

命令 --help
    获取命令选项的帮助

3、shell内部命令帮助

help shell内部命令
    获取shell内部命令的帮助

例:
whereis cd
    确定是否是shell内部命令,没有可执行文件的命令是shell内部命令
help cd
    获取内部命令帮助

4、详细命令帮助info

info 命令
    - 回车:进入子帮助页面(带有*号标记)
    - u:    进入上层页面
    - n:    进入下一个帮助小节
    - p:    进入上一个帮助小节
    - q:    退出

  

posted @ 2019-06-17 16:02  Simon丿  阅读(1619)  评论(0编辑  收藏  举报