Linux中获取帮助的命令有很多,比如:man、help、info,但是各有不同!下面我们进行实践分析一下:

1.help

命令格式:

mv --help

显示效果:提供的是一种快捷、高效的帮助

mv: illegal option -- -
usage: mv [-f | -i | -n] [-v] source target
       mv [-f | -i | -n] [-v] source ... directory

2.man

命令格式:

man mv

显示效果:man页包含的某些GNU工具信息

MV(1)                     BSD General Commands Manual                    MV(1)

NAME
     mv -- move files

SYNOPSIS
     mv [-f | -i | -n] [-v] source target
     mv [-f | -i | -n] [-v] source ... directory

DESCRIPTION
     In its first form, the mv utility renames the file named by the source
     operand to the destination path named by the target operand.  This form
     is assumed when the last operand does not name an already existing direc-
     tory.

     In its second form, mv moves each file named by a source operand to a
     destination file in the existing directory named by the directory oper-
     and.  The destination path for each operand is the pathname produced by
     the concatenation of the last operand, a slash, and the final pathname
     component of the named file.

     The following options are available:
:

3.info

命令格式:

mv --help

显示效果:比man显示更完整的最新的GNU工具信息

File: *manpages*,  Node: mv,  Up: (dir)


MV(1)                     BSD General Commands Manual                    MV(1)

NAME
     mv -- move files

SYNOPSIS
     mv [-f | -i | -n] [-v] source target
     mv [-f | -i | -n] [-v] source ... directory

DESCRIPTION
     In its first form, the mv utility renames the file named by the source
     operand to the destination path named by the target operand.  This form
     is assumed when the last operand does not name an already existing direc-
     tory.

     In its second form, mv moves each file named by a source operand to a
     destination file in the existing directory named by the directory oper-
     and.  The destination path for each operand is the pathname produced by
     the concatenation of the last operand, a slash, and the final pathname
-----Info:(*manpages*)mv,83 行 --Top---------------------------------------


总结:

  • “–help”选项并不是一个“独立”的工具。作为一种命令的选项通常由一个或两个连字符后跟一个或多个字母来指定。选项出现在所调用的工具名后,用空格隔开。工具的其它参数都跟在选项后,也用空格隔开。

  • Man和info就像两个集合,它们有一个交集部分,但与man相比,info工具可显示更完整的最新的GNU工具信息。若man页包含的某个工具的概要信息在info中也有介绍,那么man页中会有“请参考info页更详细内容”的字样。
    通常情况下,man工具显示的非GNU工具的信息是唯一的,而info工具显示的非GNU工具的信息是man页内容的副本补充。

Logo

更多推荐