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

相关推荐
ZLRRLZ1 天前
【Docker】Docker安装
运维·docker·容器
逐梦吧!旅行者1 天前
Linux之环境变量(内容由浅入深,层层递进)
linux·运维
IOT-Power1 天前
树莓派 Ubuntu 24.04 开机换源总结
linux·数据库·ubuntu
weixin_468466851 天前
树莓派32位与64位系统安装teamviewer远程软件
linux·单片机·自动化·树莓派·远程控制·vnc·teamviewer
挨踢攻城1 天前
Linux 应急响应实操 Checklist
linux·运维·linux命令·rhce·rhca·厦门微思网络·linux 应急响应
wanhengidc1 天前
什么是云手机?
运维·网络·安全·游戏·智能手机
optiz1 天前
细菌基因组genome二代测序数据分析
linux·运维·服务器
李游Leo1 天前
LaTeX TeX Live 安装与 CTAN 国内镜像配置(Windows / macOS / Linux 全流程)
linux·windows·macos
IT成长日记1 天前
【Linux基础】Linux系统管理:GPT分区实践详细操作指南
linux·运维·服务器·gpt·parted·磁盘分区·fdisk
羚羊角uou1 天前
【Linux】匿名管道和进程池
linux·c++·算法