shell的内置命令

上一篇 / 下一篇  2008-05-20 14:53:00 / 个人分类:Linux

51Testing软件测试网0L9p:wm$ht

    有时使用man查看某个命令(如cd)的帮助信息时会显示形如下面的信息:51Testing软件测试网9G SSz;`e V

MLxc Qb,O%d~t%O0

M[,E [v Uz7Li7c0BASH_BUILTINS(1)                               BASH_BUILTINS(1)

W _*|2e!X S,E#K:R&f"T4J051Testing软件测试网x+wh7KO {

NAME

+X+b/rgpE Fq(S051Testing软件测试网&EYg,kv EU

bash, :, ., [, alias, bg, bind, break, builtin, cd, command, compgen, complete, continue, declare, dirs, disown, echo,enable, eval, exec, exit, export, fc, fg, getopts, hash, help, history, jobs, kill, let, local, logout, popd

&pG puCm051Testing软件测试网{ n&oZu+t-N\X

……51Testing软件测试网0b RE5`K0EV&~Q

,Q;?g;l5aj o8@051Testing软件测试网5GlNR#V-[4QM8kx

   这表示该命令为shell的内置命令,使用type命令查看的话返回下面的信息:51Testing软件测试网0V4l(a3@|,C![

lzja0g0

51Testing软件测试网j$ee3Qay;nq]

[root@localhost ~]# type cd51Testing软件测试网#ti9KsMv:_

,iY yB){8F Z0 cd is a shell builtin

Yuq"N&ZN%EL0
51Testing软件测试网)cJx q8C)_q

51Testing软件测试网w h ]I-]w^!v

关于shell的这些内置的命令,由于执行时不需要到磁盘上查找,因此速度比较快。使用不带参数的help(bash内置命令)命令,可以查看这些内置命令列表,使用help commandname 可以查看command的详细信息。大概有下面这些内置命令:

y P:JF5F051Testing软件测试网 nARI8VHYf/Y

  %[DIGITS | WORD] [&]
+d7?!~dH q0 (( expression ))51Testing软件测试网R@|'}7Ss%ss
 [[ expression ]]51Testing软件测试网2S6g a'^B{~?
 . filename [arguments]51Testing软件测试网BYG;N/s
 :                                           
g.Z0q2d6pyX0 alias [-p] [name[=value] ... ]    51Testing软件测试网+Kss U-q,O{
 [ arg... ]                        51Testing软件测试网s:r)qP3x
 bg [job_spec]                               51Testing软件测试网WP6|CN]
 bind [-lpvsPVS] [-m keymap] [-f filename] [-q name] [-u name] [-r keyseq] [-x keyseq:shell-command] [keyseq:readline-function or readline-command]51Testing软件测试网 Ho@C aF5]@
 break [n]                                   
7O+o z]*F1o)SUK$K0 builtin [shell-builtin [arg ...]] 
(Xeb ?,e0 caller [EXPR]                               51Testing软件测试网{`k}b5`Pz,A
 case WORD in [PATTERN [| PATTERN]...) COMMANDS ;;]... esac51Testing软件测试网lD ] T+s
 cd [-L|-P] [dir]                            
9OFV fX GZ9pN%b"@0 command [-pVv] command [arg ...]  
!|/J-kd*i'F!A%WW0 compgen [-abcdefgjksuv] [-o option] [-A action] [-G globpat] [-W wordlist] [-P prefix] [-S suffix] [-X filterpat] [-F function] [-C command] [word]          
giV0{ E8\0 complete [-abcdefgjksuv] [-pr] [-o option] [-A action] [-G globpat] [-W wordlist] [-P prefix] [-S suffix] [-X filterpat] [-F function] [-C command] [name ...]
v }?8Z_9giM0 continue [n]                                
(S9kf'["t'bL ]0 declare [-afFirtx] [-p] [name[=value] ...]51Testing软件测试网 U2_ I4DHC9uC#B
 dirs [-clpv] [+N] [-N]                      51Testing软件测试网4i5?;Iw0s
 disown [-h] [-ar] [jobspec ...]   51Testing软件测试网%sz2E)jo,Mg,C
 echo [-neE] [arg ...]                       
Bat TB_%K5` v [0  enable [-pnds] [-a] [-f filename] [name ...] 51Testing软件测试网 uzL`C n |
 eval [arg ...]                              51Testing软件测试网aD ]4]w ?|
 exec [-cl] [-a name] file [redirection ...]
[6Hn,_6v?0 exit [n]                                    51Testing软件测试网'q1Xh3G9AaV5C
 export [-nf] [name[=value] ...] or export -p                              51Testing软件测试网k;O#q8V6X"o M)tpa
 false                                       51Testing软件测试网uus5xc Q
 fc [-e ename] [-nlr] [first] [last] or fc -s [pat=rep] [cmd]51Testing软件测试网/j-W8M.w0uG y#A t-V
 fg [job_spec]            
Q!i[v#wU0 for ((: for (( exp1; exp2; exp3 )); do COMMANDS; done  51Testing软件测试网Q_Rq3g0B+fB]6Q
 for NAME [in WORDS ... ;] do COMMANDS; done51Testing软件测试网]k8?5P:[g
 function NAME { COMMANDS ; } or NAME () { COMMANDS ; }
4N|&Qx/V$C+_1U0 getopts optstring name [arg]                51Testing软件测试网}!I.^ v#w#N|P,P0Co
 hash [-lr] [-p pathname] [-dt] [name ...]51Testing软件测试网}kj i#r D S
 help [-s] [pattern ...]                     51Testing软件测试网.eF7c9{8aN1GN
 hhistory [-c] [-d offset] [n] or history -awrn [filename] or history -ps arg [arg...]51Testing软件测试网O.rl ?0J!e`^
 if COMMANDS; then COMMANDS; [ elif COMMANDS; then COMMANDS; ]... [ else COMMANDS; ] fi          
x~_#B'w0 jobs [-lnprs] [jobspec ...] or jobs -x command [args]51Testing软件测试网r.k}mK rP#D
 kill [-s sigspec | -n signum | -sigspec] [pid | job]... or kill -l [sigspec]          51Testing软件测试网;F&}dQ(O)ix
 let arg [arg ...]                 
&Lf-bqF0 local name[=value] ...                      
Y8u6z`'f&P9E0 logout                            
c4~b#[8s+?X#N0 popd [+N | -N] [-n]                         
I!{z-q o;^0 printf format [arguments]         51Testing软件测试网 weQ V:NE$v1\*Y
 pushd [dir | +N | -N] [-n]                  
yHK8k pn7\8a9o0 pwd [-PL]                         51Testing软件测试网[j"F4f"^}
 read [-ers] [-u fd] [-t timeout] [-p prompt] [-a array] [-n nchars] [-d delim] [name ...]          51Testing软件测试网"Q\Qv8b;Ug
 readonly [-af] [name[=value] ...] or readonly -p 
3W7T lUVrq0 return [n]                                  51Testing软件测试网8v4A6`3I1UB9XJ0^
 select NAME [in WORDS ... ;] do COMMANDS; done
g[%W6z#H`([p+Z0 set [--abefhkmnptuvxBCHP] [-o option] [arg ...]          51Testing软件测试网G8Q5ss(~ ^$a1rI wH(s
 shift [n]                         
5og GSB0 shopt [-pqsu] [-o long-option] optname [optname...]          
hS6fHhs$u0 source filename [arguments]       51Testing软件测试网`)c;Y]o1K`
 suspend [-f]                                
h;HQ$D6n^-C4j9b f0 test [expr]                       51Testing软件测试网 B!C_,[E"l {"A
 time [-p] PIPELINE                          
z8e [){V%Rx0 times                             51Testing软件测试网,D D7T9Fj(mH!~
 trap [-lp] [arg signal_spec ...]            
9i5^ ^Y1J,?!m9O0 true                              51Testing软件测试网[V q&R u v/z9\)X
 type [-afptP] name [name ...]               51Testing软件测试网~/r$tUQ1uc1T+R }
 typeset [-afFirtx] [-p] name[=value] ...51Testing软件测试网?"I)[:R)? Qsp[
 ulimit [-SHacdflmnpstuv] [limit]            51Testing软件测试网aGk Q#d
 umask [-p] [-S] [mode]            51Testing软件测试网"e bCXE7N4tq
 unalias [-a] name [name ...]                51Testing软件测试网6Y|1D-vBxM
 unset [-f] [-v] [name ...]        
r6Q6L[(}x7w&Z,pu-F ]m0 until COMMANDS; do COMMANDS; done           
S-PrcAi0R0 variables - Some variable names and meanings51Testing软件测试网D&HK(_!L*C
 wait [n] 

m-y v,k ylj051Testing软件测试网X"]R/q^-\t0h

 51Testing软件测试网B4{c$_W j5F*h#e


TAG: Linux shell

 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

Open Toolbar