当在linux执行命令时,会根据PATH变量中路径去查找第一个匹配的命令来执行!


[root@centos 3306]# echo $PATH

/application/mysql/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

[root@centos 3306]# which init

/sbin/init

[root@centos 3306]# touch /application/mysql/bin/init

[root@centos 3306]# chmod +x /application/mysql/bin/init 

[root@centos 3306]# which init

/application/mysql/bin/init