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

相关推荐
东方芷兰12 分钟前
算法笔记 04 —— 算法初步(下)
c++·笔记·算法
和舒貌1 小时前
Linux系统编程基础详解
linux·运维·服务器·基础
Jack魏2 小时前
Linux MySQL 8.0.29 忽略表名大小写配置
linux·mysql·mysql8·mysql常见问题
ctrigger2 小时前
AI回答:Linux C/C++编程学习路线
linux·c语言·c++
蛊明4 小时前
下载CentOS 10
linux·运维·centos
北京-宏哥4 小时前
Linux系统安装MySQL5.7(其他版本类似)避坑指南
linux·运维·服务器
Aphelios3804 小时前
Linux 下 VIM 编辑器学习记录:从基础到进阶(下)
java·linux·学习·编辑器·vim
qw9494 小时前
Linux 高级篇 日志管理、定制自己的Linux系统、备份与恢复
linux·运维·服务器
丶只有影子4 小时前
【Nacos】从零开始启动Nacos服务(windows/linux)
linux·运维·windows·微服务·springcloud
青年vs阳光4 小时前
win10把c盘docker虚拟硬盘映射迁移到别的磁盘
运维·docker·容器