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其它相关文章!

相关推荐
不能跑的代码不是好代码7 小时前
Linux系统常用命令中文速查表
linux·运维·服务器
石一峰6998 小时前
深入理解 Linux 中断三层机制与 1-Wire 时序锁原理
linux·运维·服务器
运维老郭8 小时前
PostgreSQL编译安装实战
运维·postgresql
无限码农8 小时前
Linux上通过cmake编译uchardet
linux·运维·服务器
运维大师10 小时前
【Linux运维极简教程】06-网络配置与管理
linux·运维
007张三丰10 小时前
软件测试专栏(15/20):REST Assured接口自动化框架实战
运维·自动化·jenkins·接口自动化·rest·assured
ACP广源盛1392462567310 小时前
IX8024@ACP# 搭配此芯 AI 服务器 + 爱芯元智产品完整方案
大数据·运维·服务器·人工智能·分布式·嵌入式硬件
探索云原生12 小时前
终于搞懂 Kueue:5 个核心对象一次讲透
linux·docker·ai·云原生·kubernetes
huainingning13 小时前
交换机通过ftp下载文件或者传输文件到ftp服务器
运维·服务器·网络
hengcaib13 小时前
防封号电销外包公司怎么选合规线路与风控核查方法
笔记