当前位置: 首页 > article >正文

Linux命令(126)之help

linux命令之help

1.help介绍

linux命令help用来显示内置命令的帮助信息

2.help用法

help [参数] command

help参数
参数说明
-d输出每个命令的简短描述
-m以手册页格式显示命令用法
-s仅输出每个匹配命令的简短使用概要

3.实例

3.1.以手册页格式显示命令用法

命令:

help -m

[root@rhel77 ~]# help -m
GNU bash, version 4.2.46(2)-release (x86_64-redhat-linux-gnu)
These shell commands are defined internally.  Type `help' to see this list.
Type `help name' to find out more about the function `name'.
Use `info bash' to find out more about the shell in general.
Use `man -k' or `info' to find out more about commands not in this list.

A star (*) next to a name means that the command is disabled.

 job_spec [&]                                           history [-c] [-d offset] [n] or history -anrw [file>
 (( expression ))                                       if COMMANDS; then COMMANDS; [ elif COMMANDS; then C>
 . filename [arguments]                                 jobs [-lnprs] [jobspec ...] or jobs -x command [arg>
 :                                                      kill [-s sigspec | -n signum | -sigspec] pid | jobs>
 [ arg... ]                                             let arg [arg ...]
 [[ expression ]]                                       local [option] name[=value] ...
 alias [-p] [name[=value] ... ]                         logout [n]
 bg [job_spec ...]                                      mapfile [-n count] [-O origin] [-s count] [-t] [-u >
 bind [-lpvsPVS] [-m keymap] [-f filename] [-q name] >  popd [-n] [+N | -N]
 break [n]                                              printf [-v var] format [arguments]
 builtin [shell-builtin [arg ...]]                      pushd [-n] [+N | -N | dir]
 caller [expr]                                          pwd [-LP]
 case WORD in [PATTERN [| PATTERN]...) COMMANDS ;;]..>  read [-ers] [-a array] [-d delim] [-i text] [-n nch>
 cd [-L|[-P [-e]]] [dir]                                readarray [-n count] [-O origin] [-s count] [-t] [->
 command [-pVv] command [arg ...]                       readonly [-aAf] [name[=value] ...] or readonly -p
 compgen [-abcdefgjksuv] [-o option]  [-A action] [-G>  return [n]
 complete [-abcdefgjksuv] [-pr] [-DE] [-o option] [-A>  select NAME [in WORDS ... ;] do COMMANDS; done
 compopt [-o|+o option] [-DE] [name ...]                set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg>
 continue [n]                                           shift [n]
 coproc [NAME] command [redirections]                   shopt [-pqsu] [-o] [optname ...]
 declare [-aAfFgilrtux] [-p] [name[=value] ...]         source filename [arguments]
 dirs [-clpv] [+N] [-N]                                 suspend [-f]
 disown [-h] [-ar] [jobspec ...]                        test [expr]
 echo [-neE] [arg ...]                                  time [-p] pipeline
 enable [-a] [-dnps] [-f filename] [name ...]           times
 eval [arg ...]                                         trap [-lp] [[arg] signal_spec ...]
 exec [-cl] [-a name] [command [arguments ...]] [redi>  true
 exit [n]                                               type [-afptP] name [name ...]
 export [-fn] [name[=value] ...] or export -p           typeset [-aAfFgilrtux] [-p] name[=value] ...
 false                                                  ulimit [-SHacdefilmnpqrstuvx] [limit]
 fc [-e ename] [-lnr] [first] [last] or fc -s [pat=re>  umask [-p] [-S] [mode]
 fg [job_spec]                                          unalias [-a] name [name ...]
 for NAME [in WORDS ... ] ; do COMMANDS; done           unset [-f] [-v] [name ...]
 for (( exp1; exp2; exp3 )); do COMMANDS; done          until COMMANDS; do COMMANDS; done
 function name { COMMANDS ; } or name () { COMMANDS ;>  variables - Names and meanings of some shell variab>
 getopts optstring name [arg]                           wait [id]
 hash [-lr] [-p pathname] [-dt] [name ...]              while COMMANDS; do COMMANDS; done
 help [-dms] [pattern ...]                              { COMMANDS ; }
[root@rhel77 ~]# 

3.2.输出内置命令的简短描述

命令:

help -d fg

[root@rhel77 ~]# help -d fg
fg - Move job to the foreground.
[root@rhel77 ~]# 

3.3.仅输出内置命令的简短使用概要

命令:

help -s fg

[root@rhel77 ~]# help -s fg
fg: fg [job_spec]
[root@rhel77 ~]# 

3.4.显示help命令的用法

命令:

help help

[root@rhel77 ~]# help help
help: help [-dms] [pattern ...]
    Display information about builtin commands.
    
    Displays brief summaries of builtin commands.  If PATTERN is
    specified, gives detailed help on all commands matching PATTERN,
    otherwise the list of help topics is printed.
    
    Options:
      -d	output short description for each topic
      -m	display usage in pseudo-manpage format
      -s	output only a short usage synopsis for each topic matching
    	PATTERN
    
    Arguments:
      PATTERN	Pattern specifiying a help topic
    
    Exit Status:
    Returns success unless PATTERN is not found or an invalid option is given.
[root@rhel77 ~]# 


http://www.kler.cn/a/133179.html

相关文章:

  • 线段树(Segment Tree)和树状数组
  • AI大模型开发原理篇-1:语言模型雏形之N-Gram模型
  • 运算符重载(输出运算符<<) c++
  • python | OpenCV小记(一):cv2.imread(f) 读取图像操作(待更新)
  • Docker小游戏 | 使用Docker部署FC-web游戏模拟器
  • 我的求职面经:(2)C++中空指针请使用nullptr不要使用NULL
  • CentOS 7搭建Gitlab流程
  • nacos集群部署
  • 在VS Code中使用VIM
  • OSI网络模型与TCP/IP协议
  • 蓝桥杯每日一题2023.11.16
  • 春秋云境靶场CVE-2022-28512漏洞复现(sql手工注入)
  • 定时获取公网ip并发送邮件提醒
  • 【备忘】websocket学习之挖坑埋自己
  • conda从4.12升级到最新版23.9 自动升级失败 手动升级方法
  • mac苹果电脑需要安装杀毒软件吗?
  • Windows Server 2012 R2系统服务器远程桌面服务多用户登录配置分享
  • 要做好解决方案工程师,这些核心技能是必须要掌握的。
  • iceoryx(冰羚)-通信中间件解析
  • C++二分查找算法:查找和最小的 K 对数字
  • (七)什么是Vite——vite优劣势、命令
  • fopen/fwrite/fread 对UNICODE字符写入的总结
  • 【XTDrone Ubuntu20.04】XTDrone+ Ubuntu20.04 + PX4安装
  • 论文阅读:Auto White-Balance Correction for Mixed-Illuminant Scenes
  • SpringBoot学习笔记-创建个人中心页面(下)
  • 大数据-之LibrA数据库系统告警处理(ALM-12051 磁盘Inode使用率超过阈值)