那么,命令一共有几类呢? 一共是5类, 即:
alias, keyword, function, built-in,$PATH
当你键入一个命令时, 搜索到该命令的顺序也是按照上面的罗列顺序来搜索的.
命令和shell是密不可分的, 谈命令机制肯定离不开shell.
alias command
Setting: ~/.bashrc,/etc/bashrc
Shell keyword (such as if,while,until,case,for)
Function:
Example:function pwd { echo "my function pwd"; }
Shell built-in command
Run command enable to see
help command for help
PATH variable
Setting: /etc/profile, /etc/profile.d/*.sh(POSIX)
~/.bash_profile(Bash)
Load order: 1, /etc/profile (invoke /etc/profile.d/*.sh)
~/.bash_profile (invoke ~/.bashrc, then
~/.bashrc invoke /etc/bashrc)
(Note: su, su-, bash –login, bash --norc)
Include: Shell script, Binary execute file
alias, keyword, function, built-in,$PATH
当你键入一个命令时, 搜索到该命令的顺序也是按照上面的罗列顺序来搜索的.
命令和shell是密不可分的, 谈命令机制肯定离不开shell.
alias command
Setting: ~/.bashrc,/etc/bashrc
Shell keyword (such as if,while,until,case,for)
Function:
Example:function pwd { echo "my function pwd"; }
Shell built-in command
Run command enable to see
help command for help
PATH variable
Setting: /etc/profile, /etc/profile.d/*.sh(POSIX)
~/.bash_profile(Bash)
Load order: 1, /etc/profile (invoke /etc/profile.d/*.sh)
~/.bash_profile (invoke ~/.bashrc, then
~/.bashrc invoke /etc/bashrc)
(Note: su, su-, bash –login, bash --norc)
Include: Shell script, Binary execute file