
shell
郑广技术博客
当你发现自己的才华撑不起野心时,就请安静下来学习吧!
展开
-
ifstat的网卡监控软件
wgethttp://distfiles.macports.org/ifstat/ifstat-1.1.tar.gz tar xzvf ifstat-1.1.tar.gz cd ifstat-1.1 ./configure make make install [root@ansible-server ifstat-1.1]# ifstat -a lo ...原创 2019-10-14 14:52:28 · 176 阅读 · 0 评论 -
常用shell命令操作
1.判断2个目录同时存在再执行shell命令 #!/bin/bash TestPath="/volume01/edit_high/" TestPath1="/volume01_bak/edit_high/" if [ -d "$TestPath" ]&&[ -d "$TestPath1" ]; then echo "Ok"; rsync -a --delete /volume01/*原创 2017-08-23 10:58:28 · 245 阅读 · 0 评论 -
双网卡bond配置
vi /etc/sysconfig/network-scripts/ifcfg-bond0 DEVICE=bond0 BOOTPROTO=static ONBOOT=yes IPADDR=10.30.7.12 NETMASK=255.255.255.0 vi /etc/sysconfig/network GATEWAY=10.30.7.254 vi /etc/原创 2017-08-23 11:03:09 · 807 阅读 · 0 评论 -
主机静态路由添加
(1) 添加到主机的路由。 1. route add –host 192.168.1.2 dev eth0:0 2. route add –host 10.20.30.148 gw 10.20.30.40 (2) 添加到网络的路由。 3. route add –net 10.20.30.40 netmask 255.255.255.248 eth0 4. route add –原创 2017-08-23 11:05:31 · 2138 阅读 · 0 评论 -
常用日志文件查询和删除脚本
#find . -type f -atime -30 -exec mv {} ../back "; #将当前目录下最近30天访问过的文件移动到上级back目录 #find . -mmin +120 -mmin -480 -exec more {} "; #将当前目录下最近2小时到8小时之内的文件显示出来 #- #删除修改时间在30天之前的所有文件 find /usr/local/x原创 2017-08-23 11:06:28 · 278 阅读 · 0 评论 -
常用shell汇总
1、查找并删除/data这个目录7天前创建的文件 [root@ansible learngit]# find /data -ctime +7 -exec rm -fr {} \; [root@ansible learngit]# find /data -ctime +7 | xargs rm -fr [root@ansible learngit]# find / -size +500M #大于...原创 2019-10-10 11:18:56 · 409 阅读 · 0 评论