linux下Bash编程until语句及格式化硬盘分区等编写脚本(十)1.循环语句结构总结1.1.while语句当条件满足时,进入循环语句while条件;do语句done1.2.until语句当条件不满足时,进入循环语句until条件;do语句done1.3.for变量in列表;do循环体done1.4.for((表达式1;条件;表达2));do循..
分类:
系统相关 时间:
2016-04-22 16:51:48
阅读次数:
310
GUI:GraphicUserInterfacewindowsx-windowsgnomekdexfaceCLI:commandlineinterfaceshbashcshkshzshtcsh.dll动态库连接(windows).sosharedobject(linux)login:用户名:用户ID认证机制:authentication授权:authorization审计:auditionprompt,命令提示符#/bin/bash#commandopti..
分类:
系统相关 时间:
2016-04-22 16:51:13
阅读次数:
233
批量修改文件后缀第一种:#!/bin/bash
forfnin*.$1
do
mv$fn${fn%$1}$2
done第二种:find.-name"*.txt"|awk-F‘[./]+‘‘{print$2}‘|xargs-i-tmv{}.txt{}.shGREP用户小技巧文件如下:#cattest.txt
Thisisatestfile
agooddayandnocoludy
Sithereandsingasong
missagaoisting
butmon..
分类:
系统相关 时间:
2016-04-22 16:47:48
阅读次数:
207
写一个监控网站的脚本。发现不正常发邮件告警。每分钟检测一次。提示:使用curl命令检测,根据结果判断。#!/bin/bash
url=http://www.apelearn.com/bbs/forum.php
ip1=1.1.1.1
ip2=2.2.2.2
ip3=3.3.3.3
cop="--connect-timeout3-I"
check(){
curl$cop-x$1:80$url2>/dev/null..
分类:
Web程序 时间:
2016-04-22 01:14:46
阅读次数:
249
搭建SVN服务,有效的管理代码,以下三步可以快速搞定。1、安装 #yum install subversion 判断是否安装成功#subversion -v svnserve, version 1.6.11 (r934486)出现上面的提示,说明安装成功。 如果提示如下:-bash: subvers ...
分类:
其他好文 时间:
2016-04-21 21:40:44
阅读次数:
124
#!/bin/bash#SPEED=`/bin/bash/etc/zabbix/script/flow.sh|cut-d‘.‘-f1`SPEED=`/bin/bash/root/flow.sh|cut-d‘.‘-f1`[-z$SPEED]&&SPEED=1EXIST=`iptables-n-v-L|grepCC-FLOW|wc-l`if[$SPEED-gt1250];thenIP=`netstat-antup|grepESTABLISHED|awk‘{print$5}‘|grep-o"\([0..
分类:
其他好文 时间:
2016-04-21 15:24:32
阅读次数:
433
tc主脚本:#!/bin/bash#./root/tc_functionsNUM=2DEV=eth0init_tc$NUMwhile:;do#IP=`netstat-antup|grepESTABLISHED|grep80|cut-d":"-f8`IP=`netstat-antup|grepESTABLISHED|grep80|awk‘{print$5}‘|grep-o"\([0-9]\{1,3\}\.\)\{1,3\}[0-9]\{1,3\}"|sort-rn|uniq-c|awk‘{print$2..
分类:
其他好文 时间:
2016-04-21 15:22:35
阅读次数:
152
增加 [确定] and [失败]系统提示 #!/bin/bash. /etc/init.d/functionsaction "true" /bin/falseaction "false" /bin/true ...
分类:
其他好文 时间:
2016-04-21 11:36:24
阅读次数:
131
前言Git是一个开源的分布式版本控制系统。本文很多内容翻译自:
https://www.codecademy.com/learn/learn-git
使用Git的第一步是下载Git,下载地址,安装时所有选项都默认选择即可。基本工作流程1. init首先新建一个文件夹,进入文件夹后右击鼠标,选择git bash,敲打命令git initgit会生成一个隐藏的.git文件夹,里面的内容用于版本控制。...
分类:
其他好文 时间:
2016-04-21 07:31:48
阅读次数:
186
lnmp安装脚本、一起学习、有更好的建议请留言、#!/bin/bash##describe:linuxnginxmysqlphpinstallFileS=/updatefilemkdir-p$FileS#安装lrzsz方便后续文件上传wgethttp://vault.centos.org/6.5/os/x86_64/Packages/lrzsz-0.12.20-27.1.el6.x86_64.rpm-P$FileS&>/dev/nul..
分类:
其他好文 时间:
2016-04-20 23:58:12
阅读次数:
296