摘要: shell中的循环语句for循环for语法格式1:for 变量 in 值1 值2 值3 值4 值5 值6 ... ...do 命令donefor i in 1 88 3 90do echo $1done[root@vh01 script]# vim f.sh#!/bin/bashfor i in 1 阅读全文
posted @ 2021-08-08 11:45 Linux刀客 阅读(496) 评论(0) 推荐(0) 编辑
摘要: shell中的if语句格式1:单分支if [ 判断 ];then 命令fi 格式2:双分支if [ 判断 ];then 命令else 命令fi格式3:多分支if [ 判断 ];then 命令elif 命令elif 命令else 命令... ...fi#!/bin/bashnum=$[RANDOM%1 阅读全文
posted @ 2021-08-08 11:42 Linux刀客 阅读(980) 评论(0) 推荐(0) 编辑
摘要: shell的测试表达式[ 表达式 ][空格 数字 空格 数字 空格]test 表达式1、字符串测试-z 字串为空 [ -z 字符串 ]!-z字串为非空 [ !-z 字符串 ][root@vh01 ~]# a=12[root@vh01 ~]# [ -z $a ][root@vh01 ~]# echo 阅读全文
posted @ 2021-08-08 11:41 Linux刀客 阅读(109) 评论(0) 推荐(0) 编辑
摘要: shell的数值运算整数【3种】1、expr 数字 运算符 数字+ - /* / %取余[root@vh01 script]# expr 2+ 5expr: 语法错误[root@vh01 script]# expr 2 + 57[root@vh01 script]# expr 2 - 5-3[roo 阅读全文
posted @ 2021-08-08 11:40 Linux刀客 阅读(266) 评论(0) 推荐(0) 编辑
摘要: Shell 变量ip=192.168.4.254soft=ftpbaseurl=ftp://$ip/rhel6/Serveryum-y install $softservice $soft startchkconfig $soft on变量名称=变量值变量名称:字母,数字,_,但是不能以数字开始相关 阅读全文
posted @ 2021-08-08 11:39 Linux刀客 阅读(40) 评论(0) 推荐(0) 编辑
摘要: shell1、什么叫shell在linux内核与用户之间的解释器程序通常指/bin/bash负责向内核翻译及传达用户、程序指令相当于操作系统的“外壳”、2、shell的使用方式交互式 命令行非交互式 脚本硬件 系统软件【内核】 应用软件 人shell, bash, sh, kshshell[命令解释 阅读全文
posted @ 2021-08-08 11:38 Linux刀客 阅读(70) 评论(0) 推荐(0) 编辑
摘要: squid(代理服务器) client:192.168.4.1 eth0 squid:192.168.4.5 eth0 192.168.2.5 eth1 web:192.168.2.100 eth1环境配置1、真实机(确认:virbr1(192.168.4.1))web网站【加速】代理软件 varn 阅读全文
posted @ 2021-08-08 11:27 Linux刀客 阅读(417) 评论(0) 推荐(0) 编辑
摘要: 一、搭建Zabbix监控服务器1.1 准备安装环境(LAMP)[root@server cacti]# rpm -q httpd php php-mysql mysql-server mysqlyum -y install httpd yum -y install php php-mysql yum 阅读全文
posted @ 2021-07-31 09:57 Linux刀客 阅读(530) 评论(0) 推荐(0) 编辑
摘要: 一、搭建Cacti监控服务器1.1 准备安装环境[root@server cacti]# rpm -q httpd php php-mysql mysql-server mysqlyum -y install httpd yum -y install php php-mysql yum -y ins 阅读全文
posted @ 2021-07-31 09:55 Linux刀客 阅读(273) 评论(0) 推荐(0) 编辑
摘要: 一、搭建监控服务器案例:在IP地址是192.168.4.77的服务器上部署Nagios监控服务器。准备安装环境[root@server yum.repos.d]# yum repolist[root@server yum.repos.d]# rpm -q gcc gcc-c++[root@serve 阅读全文
posted @ 2021-07-31 09:54 Linux刀客 阅读(95) 评论(0) 推荐(0) 编辑