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

相关推荐
神州永泰1 小时前
检查一个CentOS服务器的配置的常用命令
linux·服务器·centos
TuringSnowy1 小时前
Maximum_Likelihood
笔记·数学建模·概率论
c无序1 小时前
【Linux-基础IO】如何理解Linux下一切皆文件&&磁盘的介绍
linux
简单.is.good2 小时前
【Linux笔记】在VMware中,为基于NAT模式运行的CentOS虚拟机设置固定的网络IP地址
linux·网络·笔记
技术卷2 小时前
golang学习笔记24-文件操作
笔记·学习·golang
霸王蟹2 小时前
uniapp中uni.request的统一封装 (ts版)
前端·javascript·vue.js·笔记·uni-app
逆旅行天涯2 小时前
【踩坑笔记】vue3 element-plus el-input 无法输入问题
vue.js·笔记·elementui
w_outlier3 小时前
匿名管道在进程池中的应用案例
linux·c++·管道通信
wyw00003 小时前
Ubuntu22.04安装VMware Tools
linux
哦*&3 小时前
ubuntu18.04 Anconda安装及使用
linux