命令是可执行的二进制程序
./test.sh #相对路径执行
/data/test.sh #绝对路径执行
source /data/test.sh #读入执行
. /data/test.sh #读入执行
bash /data/test.sh #在子shell中执行
[root@uplooking ~]# vim hello
#!/bin/bash echo "Hello World !"
[root@uplooking ~]# chmod u+x hello
[root@uplooking ~]# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
[root@uplooking ~]# cp hello /usr/local/sbin/
[root@uplooking ~]# hello
hello world!
linux 中的命令是什么?执行命令的几种方式?如何自己创建命令?
原文:https://www.cnblogs.com/github-cn/p/11258167.html