- 浏览: 4731985 次
- 性别:
- 来自: 上海
文章分类
最新评论
-
bzhao:
你也应该可以这样:(not tested)./rbtunnel ...
在Bash脚本中怎么关闭文件描述符? -
bzhao:
如果有A进程原代码情况下,通过如下调用,把他的子进程继承关闭则 ...
在Bash脚本中怎么关闭文件描述符? -
Master-Gao:
楼主咋没分析下源码呢?
我使用过的Linux命令之dirname - 截取给定路径的目录部分 -
jiedushi:
tail -F 就可以吧
Linux下实时跟踪log4j日志文件的bash脚本 - 增强了tail -f的功能 -
java_is_new:
新手学习了,就是不明白为一个网卡配多个ip有什么用
我使用过的Linux命令之ifconfig - 网络配置命令
我使用过的Linux命令之help - 显示Bash内建命令的帮助信息
本文链接:http://codingstandards.iteye.com/blog/804620 (转载请注明出处)
用途说明
help命令顾名思义就是显示帮助信息的,它是个Bash内建命令,也只是用来显示Bash内建命令的帮助信息的(Display helpful information about builtin commands)。如果要显示外部命令的帮助信息,可以使用man命令或者info命令。在使用Linux或Unix系统时,我们始终要记住,所有的命令几乎都可以在系统中找到帮助信息,而通过互联网找来的信息只是帮助你迅速入门,而且英文版的资料比中文版的资料可能更靠谱一些,本文也不例外。
常用参数
help命令如果不带任何参数,则显示Bash常用内建命令的列表。
格式:help
help命令如果跟上命令名称,则显示此命令的详细帮助信息。
格式:help COMMAND
如果只想显示简单的帮助信息,加上-s即可。
格式:help -s COMMAND
使用示例
示例一 显示内建命令列表
[root@web ~]# type -a help
help is a shell builtin <== 表明help是内建命令
[root@web ~]# help
GNU bash, version 3.2.25(1)-release (i686-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 [&] (( expression ))
. filename [arguments] :
[ arg... ] [[ expression ]]
alias [-p] [name[=value] ... ] bg [job_spec ...]
bind [-lpvsPVS] [-m keymap] [-f fi break [n]
builtin [shell-builtin [arg ...]] caller [EXPR]
case WORD in [PATTERN [| PATTERN]. cd [-L|-P] [dir]
command [-pVv] command [arg ...] compgen [-abcdefgjksuv] [-o option
complete [-abcdefgjksuv] [-pr] [-o continue [n]
declare [-afFirtx] [-p] [name[=val dirs [-clpv] [+N] [-N]
disown [-h] [-ar] [jobspec ...] echo [-neE] [arg ...]
enable [-pnds] [-a] [-f filename] eval [arg ...]
exec [-cl] [-a name] file [redirec exit [n]
export [-nf] [name[=value] ...] or false
fc [-e ename] [-nlr] [first] [last fg [job_spec]
for NAME [in WORDS ... ;] do COMMA for (( exp1; exp2; exp3 )); do COM
function NAME { COMMANDS ; } or NA getopts optstring name [arg]
hash [-lr] [-p pathname] [-dt] [na help [-s] [pattern ...]
history [-c] [-d offset] [n] or hi if COMMANDS; then COMMANDS; [ elif
jobs [-lnprs] [jobspec ...] or job kill [-s sigspec | -n signum | -si
let arg [arg ...] local name[=value] ...
logout popd [+N | -N] [-n]
printf [-v var] format [arguments] pushd [dir | +N | -N] [-n]
pwd [-LP] read [-ers] [-u fd] [-t timeout] [
readonly [-af] [name[=value] ...] return [n]
select NAME [in WORDS ... ;] do CO set [--abefhkmnptuvxBCHP] [-o opti
shift [n] shopt [-pqsu] [-o long-option] opt
source filename [arguments] suspend [-f]
test [expr] time [-p] PIPELINE
times trap [-lp] [arg signal_spec ...]
true type [-afptP] name [name ...]
typeset [-afFirtx] [-p] name[=valu ulimit [-SHacdfilmnpqstuvx] [limit
umask [-p] [-S] [mode] unalias [-a] name [name ...]
unset [-f] [-v] [name ...] until COMMANDS; do COMMANDS; done
variables - Some variable names an wait [n]
while COMMANDS; do COMMANDS; done { COMMANDS ; }
[root@web ~]# help help
help: help [-s] [pattern ...]
Display helpful information about builtin commands. If PATTERN is
specified, gives detailed help on all commands matching PATTERN,
otherwise a list of the builtins is printed. The -s option
restricts the output for each builtin command matching PATTERN to
a short usage synopsis.
[root@web ~]# help -s help
help: help [-s] [pattern ...]
[root@web ~]#
示例二 非内建命令的帮助信息
[root@web ~]# help error
-bash: help: no help topics match `error'. Try `help help' or `man -k error' or `info error'.
[root@web ~]# help ls
-bash: help: no help topics match `ls'. Try `help help' or `man -k ls' or `info ls'.
[root@web ~]# man ls
示例三 一些常用内建命令的帮助信息
[root@web ~]# help cd
cd: cd [-L|-P] [dir]
Change the current directory to DIR. The variable $HOME is the
default DIR. The variable CDPATH defines the search path for
the directory containing DIR. Alternative directory names in CDPATH
are separated by a colon (:). A null directory name is the same as
the current directory, i.e. `.'. If DIR begins with a slash (/),
then CDPATH is not used. If the directory is not found, and the
shell option `cdable_vars' is set, then try the word as a variable
name. If that variable has a value, then cd to the value of that
variable. The -P option says to use the physical directory structure
instead of following symbolic links; the -L option forces symbolic links
to be followed.
[root@web ~]# help pwd
pwd: pwd [-LP]
Print the current working directory. With the -P option, pwd prints
the physical directory, without any symbolic links; the -L option
makes pwd follow symbolic links.
[root@web ~]# help if
if: if COMMANDS; then COMMANDS; [ elif COMMANDS; then COMMANDS; ]... [ else COMMANDS; ] fi
The `if COMMANDS' list is executed. If its exit status is zero, then the
`then COMMANDS' list is executed. Otherwise, each `elif COMMANDS' list is
executed in turn, and if its exit status is zero, the corresponding
`then COMMANDS' list is executed and the if command completes. Otherwise,
the `else COMMANDS' list is executed, if present. The exit status of the
entire construct is the exit status of the last command executed, or zero
if no condition tested true.
[root@web ~]# help for
for: for NAME [in WORDS ... ;] do COMMANDS; done
The `for' loop executes a sequence of commands for each member in a
list of items. If `in WORDS ...;' is not present, then `in "$@"' is
assumed. For each element in WORDS, NAME is set to that element, and
the COMMANDS are executed.
for ((: for (( exp1; exp2; exp3 )); do COMMANDS; done
Equivalent to
(( EXP1 ))
while (( EXP2 )); do
COMMANDS
(( EXP3 ))
done
EXP1, EXP2, and EXP3 are arithmetic expressions. If any expression is
omitted, it behaves as if it evaluates to 1.
[root@web ~]# help while
while: while COMMANDS; do COMMANDS; done
Expand and execute COMMANDS as long as the final command in the
`while' COMMANDS has an exit status of zero.
[root@web ~]# help case
case: case WORD in [PATTERN [| PATTERN]...) COMMANDS ;;]... esac
Selectively execute COMMANDS based upon WORD matching PATTERN. The
`|' is used to separate multiple patterns.
[root@web ~]# help echo
echo: echo [-neE] [arg ...]
Output the ARGs. If -n is specified, the trailing newline is
suppressed. If the -e option is given, interpretation of the
following backslash-escaped characters is turned on:
\a alert (bell)
\b backspace
\c suppress trailing newline
\E escape character
\f form feed
\n new line
\r carriage return
\t horizontal tab
\v vertical tab
\\ backslash
\0nnn the character whose ASCII code is NNN (octal). NNN can be
0 to 3 octal digits
You can explicitly turn off the interpretation of the above characters
with the -E option.
[root@web ~]#
问题思考
相关资料
【1】Beyond the Code 10条捷径掌握bash
发表评论
-
在Linux用tar归档压缩文件时忽略某些文件和目录
2013-02-01 10:19 16922在Linux下,常用tar对文 ... -
使用nmap扫描服务器端口的一次操作
2012-11-01 17:00 15071使用nmap扫描服务器端口的一次操作 本文来自:http ... -
我使用过的Linux命令之wget - ooo
2011-09-14 13:10 0我使用过的Linux命令之wg ... -
推荐一篇学习Vim使用的好文:酷壳 - 简明 Vim 练级攻略
2011-09-09 12:53 9082简明 Vim 练级攻略 http://coolshell.c ... -
推荐一篇学习Vim使用的好文:酷壳 - 简明 Vim 练级攻略
2011-09-09 12:49 1简明 Vim 练级攻略 http://coolshell.c ... -
我使用过的Linux命令之:(冒号) - 啥也不做(除了……)
2011-08-29 13:18 11981我使用过的Linux命令之: ... -
我使用过的Linux命令之date - 显示、修改系统日期时间
2011-08-25 09:21 41904我使用过的Linux命令之da ... -
我使用过的Linux命令之declare - 声明shell变量(不知道没关系、知道了就更好的内建命令)
2011-08-16 09:22 21736我使用过的Linux命令之declare - 声明shell变 ... -
我使用过的Linux命令之alias - 设置命令的别名,让 Linux 命令更简练
2011-08-11 09:31 28711我使用过的Linux命令之alias - 设置命令的别名,让 ... -
我使用过的Linux命令之ar - 创建静态库.a文件
2011-08-08 10:40 51809我使用过的Linux命令之ar - 创建静态库.a文件 本 ... -
我使用过的Linux命令之crontab - 设置例行任务(类似于Windows中的任务计划)
2011-08-04 22:26 9688我使用过的Linux命令之crontab - 设置例行任务(类 ... -
我使用过的Linux命令之chmod - 改变文件/目录的访问权限
2011-08-03 21:33 10640我使用过的Linux命令之chmod - 改变文件/目录的访问 ... -
我使用过的Linux命令之export - 设置或显示环境变量
2011-08-02 19:55 25368我使用过的Linux命令之export - 设置或显示环境变量 ... -
我使用过的Linux命令之wc - 统计文件行数、单词数或字节数
2011-07-26 10:50 28932我使用过的Linux命令之wc - 统计文件行数、单词数或字节 ... -
我使用过的Linux命令之groupdel - 删除群组
2011-07-22 22:13 9619我使用过的Linux命令之gr ... -
我使用过的Linux命令之ifconfig - 网络配置命令
2011-07-21 20:43 60369我使用过的Linux命令之ifconfig - 网络配置命令 ... -
我使用过的Linux命令之ll - 列出文件/目录的详细信息
2011-07-20 21:22 7102我使用过的Linux命令之ll ... -
我使用过的Linux命令之mkdir - 创建目录
2011-07-20 20:58 13602我使用过的Linux命令之mkdir - 创建目录 本文链 ... -
我使用过的Linux命令之perror - 解释错误代码
2011-07-18 20:29 24966我使用过的Linux命令之perror - 解释错误代码 ... -
我使用过的Linux命令之ping - 测试与目标主机的连通性
2011-07-16 10:46 26251我使用过的Linux命令之ping - 测试与目标主机的连通性 ...
相关推荐
ping -t -l 65550 ip 死亡之ping(发送大于64K的文件并一直ping就成了死亡之ping) ipconfig (winipcfg) 用于windows NT及XP(windows 95 98)查看本地ip地址,ipconfig可用参数“/all”显示全部配置信息 tlist -t 以...
目的:让更多的人从零开始学会使用linux,少走弯路 演示系统:Ubuntu 10.04 desktop 适用人群:未接触或刚刚接触linux的同志们 本教程使用Ubuntu 10.04 LTS - Lucid Lynx做演示,其他版本皆大同小异,有特殊的相...
知道有些命令并不对应可执行文件,而是在 Bash 内置好的,此时可以使用 `help` 和 `help -d` 命令获取帮助信息。你可以用 `type 命令` 来判断这个命令到底是可执行文件、shell 内置命令还是别名。 - 学会使用 `>` ...
--help:显示此帮助信息并离开。 --version:显示版本信息并离开。 mount 1.作用 mount命令的作用是加载文件系统,它的用权限是超级用户或/etc/fstab中允许的使用者。 2.格式 mount -a [-fv] [-t ...
--help:显示命令帮助信息。 --version:显示命令版本信息。 示例: bash Copy code pwd pwd -L pwd -P 工作原理: pwd命令会返回你当前所在的目录的绝对路径。这个路径可以用来定位你在文件系统中的位置。 示例...
Bash脚本:备份Magento2代码+数据库该实用程序脚本可帮助您备份Magento2代码和数据库。 您可以手动运行该命令,也可以通过cronjob自动执行该命令。安装您可以简单地下载脚本文件并授予可执行文件权限。 curl -0 ...
前言 Shell有很多内置在其源代码中的命令。这些命令是内置的,所以Shell不必到磁盘上搜索它们,执行速度因此加快。不同的Shell内置命令有所不同...你可以使用 help 命令查看 Bash 内置命令的信息。以下是几种不同类型的
在本篇文章里小编给大家整理的是关于linux输入yum后提示: -bash: /usr/bin/yum: No such file or directory的解决方法,有需要的朋友们参考下。
linux shell 调试工具 bash 可以设置断点、单步跟踪; 查看指令、变量值 等等 安装: tar -xvfz bashdb-5.0-1.1.2.tar.gz cd ./ bashdb-5.0-1.1.2 ./configuration make make install 使用: bashdb + 需要调试的脚本...
Linux sed 命令 Linux sed 命令是利用脚本来处理文本文件。 sed 可依照脚本的指令来处理、编辑...-h或–help 显示帮助。 -n或–quiet或–silent 仅显示script处理后的结果。 -V或–version 显示版本信息。 动作说明:
目录基本操作bash界面输入命令帮助命令关机重启标准文件架构文件操作set $PATH variable软件安装卸载Dpkg命令apt命令卸载软件软件源程序无响应 结束进程rar的解压出错 基本操作 bash界面 【nbcc@localhost~】$ ...
Git概念和Linux命令附有我在专案期间使用的范例和参考资料\回购开始: sudo apt-get install git git init本地文件夹的git功能git add . 将您的文件添加到进行分期git commit -m "comments"提交更改git remote add ...
集合了 所有的 Unix命令大全 登陆服务器时输入 公帐号 openlab-open123 telnet 192.168.0.23 自己帐号 sd08077-you0 ftp工具 192.168.0.202 tools-toolss 老师测评网址 http://172.16.0.198:8080/poll/ 各个 ...
用于 linux的 STC 8051 ISP 编程器有关更多信息,请使用 -h help 这是 gSTCISP 的一个 hack,我将 gtk(2.0) 版本转换为命令版本,也许有人正在寻找......试试这个工具...... 只是:做~ 限制: 1. 使用TTL转USB...
linux 命令一览表 alias Create an alias • apropos Search Help manual pages (man k) aptget Search for and install software packages (Debian/Ubuntu) aptitude Search for and install software ...
SimIt-ARM-3.0 给予命令行ARM指令模拟器,短小精悍,是研究ARM处理器的好工具,该模拟器既可以运行用户级别的ELF程序,又可以模拟运行Linux操作系统;提供了简单易用的调试命令,可以逐条跟踪指令的执行。 SimIt-...
产品特点使用此工具,您可以轻松地使用以下语言快速生成Linux和Windows支持的反向Shell命令: 重击Bash反向壳网猫网猫OpenBSD 非传统PythonIPv4 IPv6 RubyPerlPHP 电源外壳节点JS TCSH Awk Java用法usage: rsh [-h] ...
我该如何使用呢? 克隆仓库运行chmod + x pma 运行bash pma或./pma(请勿以root身份运行) 我们建议先运行./pma -d来配置目录。命令是什么? Usage: pma [OPTIONS]Options: -i --install Install powercord -l --...
我只在 bash shell 下测试过,所以你可能需要这个。 用法 使用set-ipmi-pass.bash脚本将您的密码放入环境变量中: $ source ./set-ipmi-pass.bash Enter IPMI password: 然后你可以使用 ipmi 命令: ipmi ...
v-v代表vim V(1)用户命令V(1)名称v-z代表vim概要v [-a] [-c] [-l] [-[0-9]] [--debug] [- -help] [regex1 regex2 ... regexn]可用性bash,vim安装将v放在$ PATH的某个位置(例如/ usr / local / bin /)。 对于...