创建一个测试文件
seq 100 > seq.txt 法1 head -30 seq.txt|tail -11法2 sed -n '20,30p' seq.txt (必会)法3 awk '{if(NR>19&&NR<31) print $0}' seq.txt法...
假设这个目录是/shnne/,里面有log1,log2,log3..log10 十个文件[root@shnne shnne]# touch log{1..10}
[root@shnne shnne]# ls
log1 log10 log2 log3 log4 log5 log6&n...
报错如下ERROR 1418 (HY000): This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)解决方法:解决办法也有两种,第一种是在创...
2017-12-26 /
1271 次浏览 /
数据库教程
1.安装前准备环境:Linux 2.6.32-642.el6.x86_64 #1 SMP Tue May 10 17:27:01 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux下载wget http://www.keepalived.org/software/keepalived-1.1.20.tar.gzln -s /usr/src/kernels/2.6.32-696.16.1.el6.x86_64/ /usr/src/linux...
方法一:md5sum
[root@shnne scripts]# cat diffpro.sh
#!/bin/sh
path=/server/scripts/cuangai
[ ! -d $path ] && mkdir -p $path
[ ! -f $path/diff.log...
[root@shnne ~]# cat liu.log
I am shnne welcome to my blog.
[root@shnne ~]# cat liu.sh
#!/bin/sh
array=($(cat liu.log))
for((i=0;i<${#array[@]};i++))
do...
1.
[root@shnne ~]# cat slave_check.sh
#!/bin/sh
while true
do
flag=0
array=($(egrep "_Running|Behind_Master" slave.log|awk '{print $NF}'))
for&nb...
[root@shnne ~]# vim test.sh
#!/bin/sh
for ((i=0; i<=5; i++))
do
if [ $i -eq 3 ]
then
#contin...
1.
创建
[root@shnne ~]# cat mk.sh
#!/bin/sh
for((i=1; i<=10; i++))
do
j=`cat /dev/urandom|head -1|md5sum|cut -c 1-5`
touch shnne/${j}_shnne_$i.html
don...
通过for循环打印5 4 3 2 1[root@shnne ~]# cat for1.sh
#!/bin/sh
for i in 5 4 3 2 1
do
echo $i
done
[root@shnne ~]# cat for2.sh
#!/bin/sh
f...
[root@shnne ~]# cat sum_*
#!/bin/sh
sum=0
i=1
while [ $i -le 100 ]
do
let sum=sum+i
let i=i+1
done
echo $sum
#!/bin/sh
sum=0
i=1
while ((i&...
[root@shnne ~]# cat rsync_start.sh
#!/bin/bash
# chkconfig: 2345 58 80
# description: start and stop service for rsync
. /etc/init.d/functions
RSYNCBIN=&q...
echo -e "\033[30m 黑色字 \033[0m"
echo -e "\033[31m 红色字 \033[0m"
echo -e "\033[32m 绿色字 \033[0m"
echo -e ...
[root@shnne ~]# cat nginxd.sh
#!/bin/bash
# chkconfig: 2345 58 80
# description: start and stop service for nginx
#定义的变量最好是大写.
nginx_bin="/application/nginx/sbin/nginx"
pid="/application/nginx1.6.2/logs/nginx.pid"...
#!/bin/sh
port=`netstat -antup|grep mysqld|wc -l`
process=`ps -ef|grep mysqld|grep -v grep|wc -l`
if [ $port -ne 1 ] && [ $process -ne 2&nb...