help
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了help相关的知识,希望对你有一定的参考价值。
help
【功能说明】:
help - Display informationabout builtin commands. #显示内置命令的相关信息
在linux系统中,使用which找不到命令所在路径的命令都是Shell内置命令,如果想获取Shell内置命令的帮助使用help;获取shell内部命令的帮助信息,help命令只能显示shell内部的命令帮助信息;而对于外部命令的帮助信息只能使用man或者info命令查看。
【语法格式】:
help [-dms] [pattern ...]
help [选项 参数] [模式 shell内置命令]
PATTERN Pattern specifiying a help topic #指定帮助主题的模式 <内置命令>
【选项参数】:
选项 | 说明 |
-d | 显示每个主题的简短描述信息 |
-m | 以仿man手册的格式显示帮助手册 |
-s | 输出短格式的帮助信息,仅包括命令语法格式。 |
【实践操作】:
1、-d 参数实例
[[email protected] ~]# help -d cd cd - Change the shell working directory.
2、-m参数实例
[[email protected] ~]# help -m cd NAME cd -Change the shell working directory. SYNOPSIS cd[-L|-P] [dir] DESCRIPTION Changethe shell working directory. Changethe current directory to DIR. Thedefault DIR is the value of the HOMEshell variable. Thevariable CDPATH defines the search path for the directory containing DIR. Alternative directory namesin CDPATH are separated by a colon (:). A nulldirectory name is the same as the current directory. If DIR begins with aslash (/), then CDPATH is not used. If thedirectory is not found, and the shell option `cdable_vars‘ is set, the wordis assumed to be a variable name. If that variable has a value, itsvalue is used for DIR. Options: -L force symbolic links to befollowed -P use the physical directorystructure without following symbolic links Thedefault is to follow symbolic links, as if `-L‘ were specified. ExitStatus: Returns0 if the directory is changed; non-zero otherwise. SEE ALSO bash(1) IMPLEMENTATION GNUbash, version 4.1.2(1)-release (x86_64-redhat-linux-gnu) Copyright (C) 2009 Free Software Foundation, Inc. LicenseGPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
3、-s 参数实例
[[email protected] ~]# which cd /usr/bin/which: no cd in (/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin) [[email protected] ~]# help -s cd cd: cd [-L|-P] [dir] [[email protected] ~]# help cd cd: cd [-L|-P] [dir] Changethe shell working directory. Changethe current directory to DIR. Thedefault DIR is the value of the HOMEshell variable. Thevariable CDPATH defines the search path for the directory containing DIR. Alternative directory namesin CDPATH are separated by a colon (:). A nulldirectory name is the same as the current directory. If DIR begins with aslash (/), then CDPATH is not used. If thedirectory is not found, and the shell option `cdable_vars‘ is set, the wordis assumed to be a variable name. If that variable has a value, itsvalue is used for DIR. Options: -L force symbolic links to befollowed -P use the physical directorystructure without following symbolic links Thedefault is to follow symbolic links, as if `-L‘ were specified. ExitStatus: Returns0 if the directory is changed; non-zero otherwise.
本文出自 “Marin” 博客,请务必保留此出处http://marin.blog.51cto.com/11904838/1906212
以上是关于help的主要内容,如果未能解决你的问题,请参考以下文章