Centos怎么执行脚本

方法一:切换到shell脚本所在的目录(此时,称为工作目录)执行shell脚本

复制代码
cd /data/shell
./hello.sh

方法二:以绝对路径的方式去执行bash shell脚本

复制代码
/data/shell/hello.sh

方法三:直接使用bash 或sh 来执行bash shell脚本

复制代码
cd /data/shell
bash hello.sh

复制代码
cd /data/shell
sh hello.sh

方法四:在当前的shell环境中执行bash shell脚本

复制代码
cd /data/shell. hello.sh

复制代码
cd /data/shell
source hello.sh

方法五:在其他的shell环境中执行bash shell脚本

复制代码
bash /data/shell/hello.sh

复制代码
sh /data/shell/hello.sh

推荐教程:centos/" target="_blank">centos教程

以上就是centos怎么执行脚本的详细内容,更多请关注CSDN其它相关文章!

相关推荐
Acrellea15 分钟前
告别粗放式能耗管理!安科瑞EIOT平台助力产业园区智慧低碳运营
运维·安全·能源
代码村新手17 分钟前
Linux-进程概念
linux
Databuff36 分钟前
五款主流 SSH 免费工具介绍
运维·ssh·运维开发
ShineWinsu38 分钟前
对于Git:基础操作的超详细保姆级解析
linux·c++·git·面试·备份·管理·版本控制器
菜鸟学编程o42 分钟前
Linux常见指令
linux·运维·服务器
1314lay_10071 小时前
SAP 接口调用 500 Native SSL Error ,导入证书
经验分享·笔记
百里香酚兰2 小时前
【Unity学习笔记】如何把粉色Prefab还原
笔记·学习·unity
pt10432 小时前
AIOps机器学习——当警报阈值被调高之后
运维·人工智能·自动化
linan1012 小时前
android调用C++通用方式
linux·架构·智能硬件
迪康coolmu2 小时前
企业文件外发管控落地实践 —— 基于迪康端点安全一体化管理系统
运维·网络·经验分享·安全