码迷,mamicode.com
首页 >  
搜索关键字:dev/null    ( 790个结果
简单日志监控告警小脚本
#!/bin/bash #monitortomcat_log LOG_DIR=/root/catalina.out IP=`ifconfig|grep"inetaddr"|grepBcast|awk-F‘[:]+‘‘{print$4}‘` tail-Fn0$LOG_DIR|whilereadline;do echo$line|grep-i-f/root/errorword.txt>/dev/null if[$?-eq0];then echo-e"IP:$IP\nDatetime:$(dat..
分类:其他好文   时间:2016-05-19 19:31:44    阅读次数:153
三、bash脚本参数的设定
bash脚本参数的设定选择参数add|del添加删除user1-user10#!/bin/bashif[$#-lt1];thenecho"Usage:adminusersARG"exit5fiif[$1==‘--add‘];thenforIin{1..10};doifiduser$I&>/dev/null;thenecho"user$Iexists."elseuseradd-ruser$Iechouser$I|passwd--stdinuser$I&>..
分类:其他好文   时间:2016-05-19 13:32:18    阅读次数:140
之前是手动安装,现在配置vim 智能提示采用脚本安装
1 #!/bin/bash 2 3 echo "安装将花费一定时间,请耐心等待直到安装完成^_^" 4 if which apt-get >/dev/null; then 5 sudo apt-get install -y vim vim-gnome ctags xclip astyle pytho ...
分类:系统相关   时间:2016-05-19 13:07:03    阅读次数:405
记录主机安全登录脚本
PS1="`whoami`@`hostname`:"‘[$PWD]‘ history USER_IP=`who-uami2>/dev/null|awk‘{print$NF}‘|sed-e‘s/[()]//g‘` if["$USER_IP"=""] then USER_IP=`hostname` fi if[!-d/tmp/history] then mkdir/tmp/history chmod777/tmp/history fi if[!-d/tmp/history/${LOGNAME}] then ..
分类:其他好文   时间:2016-05-18 22:05:02    阅读次数:363
curl 查看一个web站点的响应时间(rt)
1. curl 查看web站点rt 2. curl的参数 -o:把curl 返回的html、js 写到垃圾回收站[ /dev/null] -s:去掉所有状态 curl -o /dev/null -w %{time_namelookup}::%{time_connect}::%{time_startt ...
分类:Web程序   时间:2016-05-11 09:32:04    阅读次数:173
mysql--多实例启动方法
启动mysql时,需要指定此实例的配置文件:/bin/sh${CmdPath}/mysqld_safe--defaults-file=/data/${port}/my.cnf2>&1>/dev/null&${CmdPath}:mysql的路径${port}:此mysql实例的端口关闭mysql时,需要指定此mysql的socket:${CmdPath}/mysqladmin-u${mysql_user}-..
分类:数据库   时间:2016-05-10 11:10:07    阅读次数:169
zabbix中统计item host template trigger的数量
#!/bin/bash #bycuizhiliangat2016-04-29 get_item_number(){ echo`mysql-h127.0.0.1-uzabbix-pzabbix_password-Dzabbix-e"selectcount(*)fromitems;"2>/dev/null|tail-1` } get_trigger_number(){ echo`mysql-h127.0.0.1-uzabbix-pzabbix_password-Dzabbix-e"selectcount(*..
分类:其他好文   时间:2016-04-30 01:10:56    阅读次数:121
shell学习随笔
cat /dev/null > 文件名   清空文件信息 垃圾桶,传送到次文件的数据都会被删除掉。 ? who  | wc -l  计算用户的个数 | (管道)可以再两个程序之间建立管道pipe:who的输出成了wc的输入。。wc列出的结果就是一登陆的用户个数。。、 printf命令  echo输出  echo $?  echo $SHELL ptintf输出不像echo那...
分类:系统相关   时间:2016-04-29 17:06:48    阅读次数:264
shell学习随笔
cat /dev/null > 文件名   清空文件信息 垃圾桶,传送到次文件的数据都会被删除掉。 ? who  | wc -l  计算用户的个数 | (管道)可以再两个程序之间建立管道pipe:who的输出成了wc的输入。。wc列出的结果就是一登陆的用户个数。。、 printf命令  echo输出  echo $?  echo $SHELL ptintf输出不像echo那...
分类:系统相关   时间:2016-04-26 19:50:39    阅读次数:225
Shell标准输出、标准错误 >/dev/null 2>&1
shell中可能经常能看到:>/dev/null 2>&1 eg:sudo kill -9 `ps -elf |grep -v grep|grep $1|awk '{print $4}'` 1>/dev/null 2>/dev/null 命令的结果可以通过%>的形式来定义输出/dev/null 代表 ...
分类:系统相关   时间:2016-04-25 11:48:46    阅读次数:221
790条   上一页 1 ... 53 54 55 56 57 ... 79 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!