---
title: "centos linux 实现开机自动运行脚本"
author: "educast"
date: "2015-03-12T10:33:28Z"
tags: []
categories: ["操作系统"]
slug: "centos-linux"
draft: false
lastmod: "2015-03-12T10:33:28Z"
id: 2191714
url: "https://educast.iteye.com/blog/2191714"
---

run.sh 文件内容如下：

 

#!/bin/bash

cd /home/lyh/CMCC  
echo "You Haved Started !" &gt; log.txt

 

/etc/rc.d/rc.local 文件中添加如下内容：

 

bash /home/lyh/CMCC/run.sh