diff --git a/README.md b/README.md index b2b2ff6..b8cdecf 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,6 @@ -# 操作系统指南 +# Linux 教程 -> 作为研发工程师,谁还没干过点运维的活?:joy: -> -> 搞运维,怎么着也得懂点操作系统相关。 -> -> 本项目,就是本人在日常学习工作中,对于操作系统、运维部署等相关知识的整理。 - -## :memo: 知识点 - -### [Linux](docs/linux) - -#### [Linux 命令](docs/linux/cli) +## [Linux 命令](docs/linux/cli) > 根据应用场景,将常见 Linux 命令分门别类的一一介绍。 > @@ -26,57 +16,47 @@ 8. [Linux 硬件管理](docs/linux/cli/08.Linux硬件管理.md) - 关键词:`df`, `du`, `top`, `free`, `iotop` 9. [Linux 软件管理](docs/linux/cli/09.Linux软件管理.md) - 关键词:`rpm`, `yum`, `apt-get` -#### [Linux 工具](docs/linux/tool) +## [Linux 工具](docs/linux/tool) - [Git](docs/linux/tool/git) - [Vim](docs/linux/tool/vim.md) -#### [Linux 脚本编程](docs/linux/scripts) +## [Linux 脚本](docs/linux/scripts) - [一篇文章让你彻底掌握 shell 语言](docs/linux/scripts/shell.md) -- [Python](docs/linux/scripts/python.md) +- [一篇文章让你彻底掌握 python 语言](docs/linux/scripts/python.md) -#### [Linux 运维](docs/linux/ops) +## [Linux 运维](docs/linux/ops) -#### Linux 服务器运维 +### Linux 服务器运维 - [Linux 典型运维应用](docs/linux/ops/linux典型运维应用.md) - [samba 使用详解](docs/linux/ops/samba使用详解.md) -#### 应用、服务、工具运维和调优 +### 软件安装、配置、调优 > :bulb: **说明** > > 这里总结了一些常用开发软件的安装、配置、使用指南。 > -> 此外,提供了一键安装、配置脚本,:point_right: [**软件安装配置脚本**](https://github.com/dunwu/os-tutorial/tree/master/codes/linux/ops/soft)。 +> 此外,提供了一键安装、配置脚本,:point_right: [**软件安装配置脚本**](https://github.com/dunwu/linux-tutorial/tree/master/codes/linux/ops/soft)。 > -> [环境部署工具](https://github.com/dunwu/os-tutorial/tree/master/codes/deploy) :适合开发、运维人员,在 [CentOS](https://www.centos.org/) 机器上安装常用命令工具或开发软件。 +> [环境部署工具](https://github.com/dunwu/linux-tutorial/tree/master/codes/deploy) :适合开发、运维人员,在 [CentOS](https://www.centos.org/) 机器上安装常用命令工具或开发软件。 -- 研发环境 - - [JDK](docs/linux/ops/soft/jdk.md) - - [Maven、Nexus](https://github.com/dunwu/javastack/tree/master/docs/javatool/build/maven) - - [Nginx](https://github.com/dunwu/nginx-tutorial) - - [Nodejs](docs/linux/ops/soft/nodejs.md) - - [Tomcat](docs/linux/ops/soft/tomcat.md) - - [Zookeeper](docs/linux/ops/soft/zookeeper.md) -- 研发工具 - - [Jenkins](docs/linux/ops/soft/jenkins.md) - 持续集成和持续交付平台。 - - [Elastic](docs/linux/ops/soft/elastic) - 常被称为 `ELK` ,是 Java 世界最流行的分布式日志解决方案 。 `ELK` 是 Elastic 公司旗下三款产品 [ElasticSearch](https://www.elastic.co/products/elasticsearch) 、[Logstash](https://www.elastic.co/products/logstash) 、[Kibana](https://www.elastic.co/products/kibana) 的首字母组合。 -- 版本控制 - - Gitlab - Git 代码管理平台 - - [Svn](docs/linux/ops/soft/svn.md) - Svn 是 Subversion 的简称,是一个开放源代码的版本控制系统,它采用了分支管理系统。 -- 消息中间件 - - [Kafka](docs/linux/ops/soft/kafka.md) - 应该是 Java 世界最流行的消息中间件了吧。 - - [RocketMQ](docs/linux/ops/soft/rocketmq.md) - 阿里巴巴开源的消息中间件。 -- 数据库 - - [Mysql](https://github.com/dunwu/database/blob/master/docs/mysql/install-mysql.md) - 关系型数据库 - - [PostgreSQL](https://github.com/dunwu/database/blob/master/docs/postgresql.md#安装) - 关系型数据库 - - [Mongodb](https://github.com/dunwu/database/blob/master/docs/mongodb/install-mongodb.md) - Nosql - - [Redis](https://github.com/dunwu/database/blob/master/docs/redis/install-redis.md) - Nosql +| 软件 | 说明 | +| ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| [JDK 安装](docs/linux/ops/soft/jdk.md) | 不解释 | +| [Elastic 安装](docs/linux/ops/soft/elastic) | 常被称为 ELK ,是 Java 世界最流行的分布式日志解决方案 。 ELK 是 Elastic 公司旗下三款产品 ElasticSearch 、Logstash 、Kibana 的首字母组合。 | +| Gitlab | Git 代码管理平台 | +| [Jenkins 安装](docs/linux/ops/soft/jenkins.md) | 持续集成和持续交付平台。 | +| [Kafka 安装](docs/linux/ops/soft/kafka.md) | 应该是 Java 世界最流行的消息中间件了吧。 | +| [Maven 安装](https://github.com/dunwu/java-tutorial/blob/master/docs/javatool/build/maven/maven-install.md) | Java 构建工具 | +| [Nexus 安装](https://github.com/dunwu/java-tutorial/blob/master/docs/javatool/build/maven/nexus.md) | Maven 私服 | +| [Nginx 教程](https://github.com/dunwu/nginx-tutorial) | 反向代理服务器 | +| [Nodejs 安装](docs/linux/ops/soft/nodejs.md) | 不解释 | +| [RocketMQ 安装](docs/linux/ops/soft/rocketmq.md) | 阿里巴巴开源的消息中间件。 | +| [Svn 安装](docs/linux/ops/soft/svn.md) | Svn 是 Subversion 的简称,是一个开放源代码的版本控制系统,它采用了分支管理系统。 | +| [Tomcat 安装](docs/linux/ops/soft/tomcat.md) | Java 应用服务器 | +| [Zookeeper 安装](docs/linux/ops/soft/zookeeper.md) | 分布式系统协调软件 | -### [Windows](docs/windows) - -- [Windows 工具](docs/windows/Windows工具.md) - -### [Docker](docs/docker) +## [Docker](docs/docker) diff --git a/codes/linux/ops/soft/README.md b/codes/linux/ops/soft/README.md index e5fceb8..43b2688 100644 --- a/codes/linux/ops/soft/README.md +++ b/codes/linux/ops/soft/README.md @@ -11,8 +11,8 @@ 执行以下任意命令即可执行安装脚本。 ```sh -curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/zsh-install.sh | bash -wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/zsh-install.sh | bash +curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/zsh-install.sh | bash +wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/zsh-install.sh | bash ``` ## JDK8 安装 @@ -26,8 +26,8 @@ JDK8 会被安装到 `/usr/lib/jvm/java` 路径。 执行以下任意命令即可执行安装脚本。 ```sh -curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/jdk8-install.sh | bash -wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/jdk8-install.sh | bash +curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/jdk8-install.sh | bash +wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/jdk8-install.sh | bash ``` ## Maven 安装配置 @@ -42,8 +42,8 @@ wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux 执行以下任意命令即可执行安装脚本。 ```sh -curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/maven-install.sh | bash -wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/maven-install.sh | bash +curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/maven-install.sh | bash +wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/maven-install.sh | bash ``` ## Node.js 安装 @@ -57,8 +57,8 @@ wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux 执行以下任意命令即可执行安装脚本。 ```sh -curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/nodejs-install.sh | bash -wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/nodejs-install.sh | bash +curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/nodejs-install.sh | bash +wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/nodejs-install.sh | bash ``` ## MongoDB 安装 @@ -72,8 +72,8 @@ wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux 执行以下任意命令即可执行安装脚本。 ```sh -curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/mongodb-install.sh | bash -wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/mongodb-install.sh | bash +curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/mongodb-install.sh | bash +wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/mongodb-install.sh | bash ``` ## Redis 安装 @@ -87,8 +87,8 @@ wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux 执行以下任意命令即可执行安装脚本。 ```sh -curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/redis-install.sh | bash -wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/redis-install.sh | bash +curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/redis-install.sh | bash +wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/redis-install.sh | bash ``` ## Tomcat8 安装 @@ -100,8 +100,8 @@ wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux 使用方法: ```sh -curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/tomcat8-install.sh | bash -wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/tomcat8-install.sh | bash +curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/tomcat8-install.sh | bash +wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/tomcat8-install.sh | bash ``` ## Kafka 安装 @@ -113,8 +113,8 @@ wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux 使用方法:执行以下任意命令即可执行脚本。 ```sh -curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/kafka-install.sh | bash -wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/kafka-install.sh | bash +curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/kafka-install.sh | bash +wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/kafka-install.sh | bash ``` ## RocketMQ 安装 @@ -126,8 +126,8 @@ wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux 使用方法:执行以下任意命令即可执行脚本。 ```sh -curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/rocketmq-install.sh | bash -wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/rocketmq-install.sh | bash +curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/rocketmq-install.sh | bash +wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/rocketmq-install.sh | bash ``` ## ZooKeeper 安装 @@ -139,7 +139,7 @@ wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux 使用方法:执行以下任意命令即可执行脚本。 ```sh -curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/zookeeper-install.sh | bash -wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/zookeeper-install.sh | bash +curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/zookeeper-install.sh | bash +wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/zookeeper-install.sh | bash ``` diff --git a/codes/linux/ops/soft/elk/install-elk.sh b/codes/linux/ops/soft/elk/install-elk.sh index 199e238..47e9f6c 100644 --- a/codes/linux/ops/soft/elk/install-elk.sh +++ b/codes/linux/ops/soft/elk/install-elk.sh @@ -76,7 +76,7 @@ replaceLogstashConfig() { sed -i "s/# http.host: \"127.0.0.1\"/ http.host: ${IP}/g" ${ELASTIC_SOFTWARE_PATH}/logstash-${version}/config/logstash.yml touch ${ELASTIC_SOFTWARE_PATH}/logstash-${version}/bin/nohup.out cd ${ELASTIC_SOFTWARE_PATH}/logstash-${version}/bin - wget "https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/elk/config/logstash.conf" + wget "https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/elk/config/logstash.conf" } # 替换 Kibana 配置 @@ -125,6 +125,6 @@ replaceFilebeatConfig # 最后,将启动脚本下载到本地 mkdir -p /home/zp/script -wget -P /home/zp/script "https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/elk/boot-elk.sh" +wget -P /home/zp/script "https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/elk/boot-elk.sh" #setPrivilegeForUser diff --git a/codes/linux/ops/soft/main.sh b/codes/linux/ops/soft/main.sh index 29fb8a5..e95c1e4 100644 --- a/codes/linux/ops/soft/main.sh +++ b/codes/linux/ops/soft/main.sh @@ -17,16 +17,16 @@ do path=$(cd "$(dirname "$0")"; pwd) case ${item} in "git") yum install -y git ;; - "zsh") curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/zsh-install.sh | bash ;; - "jdk") curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/jdk8-install.sh | bash ;; - "maven") curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/maven-install.sh | bash ;; - "nodejs") curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/nodejs-install.sh | bash ;; - "mongodb") curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/mongodb-install.sh | bash ;; - "redis") curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/redis-install.sh | bash ;; - "tomcat") curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/tomcat8-install.sh | bash ;; - "kafka") curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/kafka-install.sh | bash ;; - "rocketmq") curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/rocketmq-install.sh | bash ;; - "zookeeper") curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/zookeeper-install.sh | bash ;; + "zsh") curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/zsh-install.sh | bash ;; + "jdk") curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/jdk8-install.sh | bash ;; + "maven") curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/maven-install.sh | bash ;; + "nodejs") curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/nodejs-install.sh | bash ;; + "mongodb") curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/mongodb-install.sh | bash ;; + "redis") curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/redis-install.sh | bash ;; + "tomcat") curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/tomcat8-install.sh | bash ;; + "kafka") curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/kafka-install.sh | bash ;; + "rocketmq") curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/rocketmq-install.sh | bash ;; + "zookeeper") curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/zookeeper-install.sh | bash ;; *) echo -e "输入项不支持!" main diff --git a/codes/linux/ops/soft/maven-install.sh b/codes/linux/ops/soft/maven-install.sh index 8ad2dba..b8c7c96 100644 --- a/codes/linux/ops/soft/maven-install.sh +++ b/codes/linux/ops/soft/maven-install.sh @@ -38,6 +38,6 @@ source /etc/profile # 备份并替换 settings.xml,使用 aliyun 镜像加速 maven echo -e "\n>>>>>>>>> replace ${path}/conf/settings.xml" cp ${path}/conf/settings.xml ${path}/conf/settings.xml.bak -wget -N https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/config/settings-aliyun.xml -O ${path}/conf/settings.xml +wget -N https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/config/settings-aliyun.xml -O ${path}/conf/settings.xml mvn -v diff --git a/codes/linux/ops/soft/nginx/README.md b/codes/linux/ops/soft/nginx/README.md index a82b167..089114f 100644 --- a/codes/linux/ops/soft/nginx/README.md +++ b/codes/linux/ops/soft/nginx/README.md @@ -5,7 +5,7 @@ 使用方法: ```sh -curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/nginx/install-nginx.sh | bash +curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/nginx/install-nginx.sh | bash ``` 脚本会下载解压 nginx 到 `/opt/nginx` 路径下。 @@ -15,6 +15,6 @@ curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ 使用方法: ```sh -curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/nginx/install-nginx-by-yum.sh | bash +curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/nginx/install-nginx-by-yum.sh | bash ``` diff --git a/codes/linux/ops/soft/redis-config.sh b/codes/linux/ops/soft/redis-config.sh index 60c07bd..8e609cc 100644 --- a/codes/linux/ops/soft/redis-config.sh +++ b/codes/linux/ops/soft/redis-config.sh @@ -17,4 +17,4 @@ fi echo -e "\n>>>>>>>>> config redis" cp ${path}/redis.conf ${path}/redis.conf.default -wget -N https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/config/redis-remote-access.conf -O ${path}/redis.conf +wget -N https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/config/redis-remote-access.conf -O ${path}/redis.conf diff --git a/codes/linux/ops/sys/README.md b/codes/linux/ops/sys/README.md index c19bca3..8946703 100644 --- a/codes/linux/ops/sys/README.md +++ b/codes/linux/ops/sys/README.md @@ -20,8 +20,8 @@ 使用方法:执行以下任意命令即可执行脚本。 ```sh -curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/sys/yum/change-yum-repo.sh | bash -wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/sys/yum/change-yum-repo.sh | bash +curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/sys/yum/change-yum-repo.sh | bash +wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/sys/yum/change-yum-repo.sh | bash ``` ## 安装基本工具(可选) @@ -45,8 +45,8 @@ wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux 使用方法:执行以下任意命令即可执行脚本。 ```sh -curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/sys/install-tools.sh | bash -wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/sys/install-tools.sh | bash +curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/sys/install-tools.sh | bash +wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/sys/install-tools.sh | bash ``` ## 安装常见 lib @@ -63,8 +63,8 @@ lib 清单(可以根据需要,在 install-libs.sh 中把不需要的工具 使用方法:执行以下任意命令即可执行脚本。 ```sh -curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/sys/install-libs.sh | bash -wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/sys/install-libs.sh | bash +curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/sys/install-libs.sh | bash +wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/sys/install-libs.sh | bash ``` ## 关闭防火墙 @@ -72,8 +72,8 @@ wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux 使用方法:执行以下任意命令即可执行脚本。 ```sh -curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/sys/stop-firewall.sh | bash -wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/sys/stop-firewall.sh | bash +curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/sys/stop-firewall.sh | bash +wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/sys/stop-firewall.sh | bash ``` ## 设置 DNS @@ -81,8 +81,8 @@ wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux 使用方法:执行以下任意命令即可执行脚本。 ```sh -curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/sys/set-dns.sh | bash -wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/sys/set-dns.sh | bash +curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/sys/set-dns.sh | bash +wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/sys/set-dns.sh | bash ``` ## 设置 ntp @@ -90,6 +90,6 @@ wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux 使用方法:执行以下任意命令即可执行脚本。 ```sh -curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/sys/set-ntp.sh | bash -wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/sys/set-ntp.sh | bash +curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/sys/set-ntp.sh | bash +wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/sys/set-ntp.sh | bash ``` diff --git a/codes/linux/ops/sys/yum/README.md b/codes/linux/ops/sys/yum/README.md index cfc84db..ddfded6 100644 --- a/codes/linux/ops/sys/yum/README.md +++ b/codes/linux/ops/sys/yum/README.md @@ -7,6 +7,6 @@ 使用方法:执行以下任意命令即可执行脚本。 ```sh -curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/sys/yum/change-yum-repo.sh | bash -wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/sys/yum/change-yum-repo.sh | bash +curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/sys/yum/change-yum-repo.sh | bash +wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/sys/yum/change-yum-repo.sh | bash ``` diff --git a/codes/linux/ops/sys/yum/change-yum-repo.sh b/codes/linux/ops/sys/yum/change-yum-repo.sh index c9977af..660033f 100644 --- a/codes/linux/ops/sys/yum/change-yum-repo.sh +++ b/codes/linux/ops/sys/yum/change-yum-repo.sh @@ -23,7 +23,7 @@ cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak # 根据发型版本选择相应 yum 镜像 if [[ ${version} == 5 ]]; then # Cento5 已废弃,只能使用 http://vault.CentOS.org/ 替换,但由于是国外镜像,速度较慢 - wget -N https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/sys/yum/Centos-5.repo -O /etc/yum.repos.d/CentOS-Base.repo + wget -N https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/sys/yum/Centos-5.repo -O /etc/yum.repos.d/CentOS-Base.repo # 根据实际发型版本情况替换 detailVersion=`lsb_release -r | awk '{print substr($2,1,3)}'` @@ -32,9 +32,9 @@ if [[ ${version} == 5 ]]; then # 不替换下面的开关,可能会出现错误:Could not open/read repomd.xml sed -i 's/enabled=1/enabled=0/g' /etc/yum.repos.d/CentOS-Media.repo elif [[ ${version} == 6 ]]; then - wget -N https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/sys/yum/Centos-6.repo -O /etc/yum.repos.d/CentOS-Base.repo + wget -N https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/sys/yum/Centos-6.repo -O /etc/yum.repos.d/CentOS-Base.repo elif [[ ${version} == 7 ]]; then - wget -N https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/sys/yum/Centos-7.repo -O /etc/yum.repos.d/CentOS-Base.repo + wget -N https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/sys/yum/Centos-7.repo -O /etc/yum.repos.d/CentOS-Base.repo else echo -e "版本不支持,替换 yum repo 失败" fi diff --git a/codes/shell/demos/README.md b/codes/shell/demos/README.md index 2005a90..7f6702e 100644 --- a/codes/shell/demos/README.md +++ b/codes/shell/demos/README.md @@ -1,3 +1,3 @@ # Shell 示例源码 -> 本目录的代码是和 『[一篇文章让你彻底掌握 shell 语言](https://github.com/dunwu/os-tutorial/blob/master/docs/linux/scripts/shell.md)』 相配套的示例代码。 +> 本目录的代码是和 『[一篇文章让你彻底掌握 shell 语言](https://github.com/dunwu/linux-tutorial/blob/master/docs/linux/scripts/shell.md)』 相配套的示例代码。 diff --git a/docs/README.md b/docs/README.md index 88a2d0a..dcd4f05 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,6 +1,6 @@ # 操作系统 -> :dart: 所有配套源码整理归档在 [**os-tutorial**](https://github.com/dunwu/os-tutorial) 项目中。 +> :dart: 所有配套源码整理归档在 [**linux-tutorial**](https://github.com/dunwu/linux-tutorial) 项目中。 ## :memo: 知识点 @@ -12,4 +12,4 @@ ## :door: 传送门 -| [回首頁](https://github.com/dunwu/os-tutorial) | +| [回首頁](https://github.com/dunwu/linux-tutorial) | diff --git a/docs/linux/README.md b/docs/linux/README.md index a5a6268..e366df3 100644 --- a/docs/linux/README.md +++ b/docs/linux/README.md @@ -90,4 +90,4 @@ ## :door: 传送门 -| [回首頁](https://github.com/dunwu/os-tutorial) | +| [回首頁](https://github.com/dunwu/linux-tutorial) | diff --git a/docs/linux/scripts/shell.md b/docs/linux/scripts/shell.md index a2c5bb4..866f4ff 100644 --- a/docs/linux/scripts/shell.md +++ b/docs/linux/scripts/shell.md @@ -5,7 +5,7 @@ > 本文主要介绍 bash 的语法,对于 linux 指令不做任何介绍。 > > :notebook: 本文已归档到:「[blog](https://github.com/dunwu/blog)」 -> :keyboard: 本文的源码已归档到 [os-tutorial](https://github.com/dunwu/os-tutorial/tree/master/codes/shell/demos) +> :keyboard: 本文的源码已归档到 [linux-tutorial](https://github.com/dunwu/linux-tutorial/tree/master/codes/shell/demos) ``` ███████╗██╗ ██╗███████╗██╗ ██╗ @@ -173,7 +173,7 @@ chmod +x /path/to/script.sh #使脚本具有执行权限 这种方式要求脚本文件的第一行必须指明运行该脚本的程序,比如: -**:keyboard: 『示例源码』** [helloworld.sh](https://github.com/dunwu/os-tutorial/tree/master/codes/shell/demos/helloworld.sh) +**:keyboard: 『示例源码』** [helloworld.sh](https://github.com/dunwu/linux-tutorial/tree/master/codes/shell/demos/helloworld.sh) ```bash #!/usr/bin/env bash @@ -207,7 +207,7 @@ shell 语法中,注释是特殊的语句,会被 shell 解释器忽略。 - 单行注释 - 以 `#` 开头,到行尾结束。 - 多行注释 - 以 `:< > `continue`语句用来跳过某次迭代。 -**:keyboard: 『示例源码』** [break-demo.sh](https://github.com/dunwu/os-tutorial/blob/master/codes/shell/demos/statement/break-demo.sh) +**:keyboard: 『示例源码』** [break-demo.sh](https://github.com/dunwu/linux-tutorial/blob/master/codes/shell/demos/statement/break-demo.sh) ```bash # 查找 10 以内第一个能整除 2 和 3 的正整数 @@ -1244,7 +1244,7 @@ done # Output: 6 ``` -**:keyboard: 『示例源码』** [continue-demo.sh](https://github.com/dunwu/os-tutorial/blob/master/codes/shell/demos/statement/continue-demo.sh) +**:keyboard: 『示例源码』** [continue-demo.sh](https://github.com/dunwu/linux-tutorial/blob/master/codes/shell/demos/statement/continue-demo.sh) ```bash # 打印10以内的奇数 @@ -1280,7 +1280,7 @@ bash 函数定义语法如下: > 3. 函数返回值在调用该函数后通过 `$?` 来获得。 > 4. 所有函数在使用前必须定义。这意味着必须将函数放在脚本开始部分,直至 shell 解释器首次发现它时,才可以使用。调用函数仅使用其函数名即可。 -**:keyboard: 『示例源码』** [function-demo.sh](https://github.com/dunwu/os-tutorial/tree/master/codes/shell/demos//function/function-demo.sh) +**:keyboard: 『示例源码』** [function-demo.sh](https://github.com/dunwu/linux-tutorial/tree/master/codes/shell/demos//function/function-demo.sh) ```bash #!/usr/bin/env bash @@ -1346,7 +1346,7 @@ the result is: 100 | `$#` | 不包括`$0`在内的位置参数的个数 | | `$FUNCNAME` | 函数名称(仅在函数内部有值) | -**:keyboard: 『示例源码』** [function-demo2.sh](https://github.com/dunwu/os-tutorial/tree/master/codes/shell/demos//function/function-demo2.sh) +**:keyboard: 『示例源码』** [function-demo2.sh](https://github.com/dunwu/linux-tutorial/tree/master/codes/shell/demos//function/function-demo2.sh) ```bash #!/usr/bin/env bash @@ -1406,7 +1406,7 @@ $ ./function-demo2.sh 10 20 | `$-` | 返回 Shell 使用的当前选项,与 set 命令功能相同。 | | `$?` | 函数返回值 | -**:keyboard: 『示例源码』** [function-demo3.sh](https://github.com/dunwu/os-tutorial/tree/master/codes/shell/demos//function/function-demo3.sh) +**:keyboard: 『示例源码』** [function-demo3.sh](https://github.com/dunwu/linux-tutorial/tree/master/codes/shell/demos//function/function-demo3.sh) ```bash runner() { @@ -1644,7 +1644,7 @@ $ ./my_script 有时我们值需要 debug 脚本的一部分。这种情况下,使用`set`命令会很方便。这个命令可以启用或禁用选项。使用`-`启用选项,`+`禁用选项: -**:keyboard: 『示例源码』** [debug-demo.sh](https://github.com/dunwu/os-tutorial/blob/master/codes/shell/demos/debug-demo.sh) +**:keyboard: 『示例源码』** [debug-demo.sh](https://github.com/dunwu/linux-tutorial/blob/master/codes/shell/demos/debug-demo.sh) ```bash # 开启 debug