摘要: 选项 阅读全文
posted @ 2019-03-18 08:53 New_Journey 阅读(814) 评论(0) 推荐(0) 编辑
摘要: 其中用到的知识点: echo $RANDOM 随机生成一串数字 md5sum将某串数字或字符转成长串字符 cut -c 1-8 取1到8位字符 阅读全文
posted @ 2019-03-16 13:46 New_Journey 阅读(1244) 评论(0) 推荐(0) 编辑
摘要: #!/bin/bash ping_success_status() { if ping -c 1 $IP >/dev/null;then echo "$IP Ping is successful!" continue fi } IP_LIST="192.168.164.1 58.87.108.139"... 阅读全文
posted @ 2019-03-16 12:43 New_Journey 阅读(350) 评论(0) 推荐(0) 编辑
摘要: #!/bin/bash check_url() { HTTP_CODE=$(curl -o /dev/null --connect-timeout 3 -s -w "%{http_code}" $1) if [ $HTTP_CODE -eq 200 ];then continue fi } URL_LIST="www... 阅读全文
posted @ 2019-03-16 12:40 New_Journey 阅读(251) 评论(0) 推荐(0) 编辑
摘要: #!/bin/bash check_url() { HTTP_CODE=$(curl -o /dev/null --connect-timeout 3 -s -w "%{http_code}" $1) if [ $HTTP_CODE -ne 200 ];then echo "Warning: $1 Access failure!" ... 阅读全文
posted @ 2019-03-16 12:39 New_Journey 阅读(403) 评论(0) 推荐(0) 编辑
摘要: #!/bin/bash DATE=$(date +%F" "$H:$M) IP=$(ifconfig | awk -F'[ :]+' NR==2'{print $4}') MAIL="13102133719@163.com" TOTAL=$(fdisk -l |awk -F'[: ]+' 'BEGIN{OFS="="}/^Disk \/dev/{printf "%s=%sG,",$2,$3}')... 阅读全文
posted @ 2019-03-16 12:33 New_Journey 阅读(307) 评论(0) 推荐(0) 编辑
摘要: #!/bin/bash DATE=$(date +%F" "%H:%M) IP=$(ifconfig eth0 | awk -F '[ :]+' '/inet addr/{print $4}') MAIL="13102133719@163.com" TOTAL=$(free -m | awk '/Mem/{print $2}') USE=$(free -m | awk '/Mem/{print ... 阅读全文
posted @ 2019-03-16 12:32 New_Journey 阅读(315) 评论(0) 推荐(0) 编辑
摘要: #!/bin/bash DATE=$(date +%F" "%H:%M) #只支持centos6 IP=$(ifconfig eth0 | awk -F '[ :]+' '/inet addr/{print $4}') MAIL="13102133719@126.com" if ! which vmstat &>/dev/null; then echo "vmstat comma... 阅读全文
posted @ 2019-03-16 12:31 New_Journey 阅读(713) 评论(0) 推荐(0) 编辑
摘要: 选项: 示例:以/etc/passwd为例来演示说明 例1: -f指定字段 打印1,6,7列的数据 选项-d是用来定义分隔符的 -f n-m意思是打印第n到第m个字段 --output-delimiter指定输出使用新的分界符 例: --complement 打印除了限制条件的所有列 例 选项-c的 阅读全文
posted @ 2019-03-16 10:56 New_Journey 阅读(224) 评论(0) 推荐(0) 编辑
摘要: 选项 例1:显示单个文件的大小(默认单位K) 例2:显示某个目录的总大小 例3:输出当前目录下各个子目录所用的空间 阅读全文
posted @ 2019-03-15 21:45 New_Journey 阅读(276) 评论(0) 推荐(0) 编辑