批量重命名脚步记录,以备用假如有一批11.txt 12.txt 13,txt 14.txt 15.txt脚步要要重命名为1.txt 2.txt 3.txt ....脚本如下:#!/bin/bashcount=1for i in *.txtdo new=$count.${i#*.} mv $i $ne...
分类:
系统相关 时间:
2015-11-13 17:07:27
阅读次数:
237
一、基础环境
1、版本
cat/etc/debian_version
7.8
2、内核
uname-r
3.2.0-4-amd64
3、ip(eth0)
10.1.10.117
10.1.10.185
4、2台机器上都设置权限
grantallprivilegeson`xxx%`.*to‘jimmy‘@‘10.1.10.%‘identifiedby‘redhat‘;
flushprivileges;
5、要注意数据库必须监听在相..
分类:
数据库 时间:
2015-10-29 11:27:44
阅读次数:
490
接上篇介绍《基于CentOS的Mysql学习补充二--使用Shell创建数据库》,本文继续探索关于Shell和MySQL的结合使用,我不知道当一个数据库设计完成之后如何快速的创建设计好的数据库表和添加相应基本数据,我目前知道的就是使用Shell和SQL脚本来达到我的目的--快速的、多次的、可重复利用的创建数据库表。
创建一个数据库表的SQL脚本:
/**********************...
分类:
数据库 时间:
2015-07-22 18:51:49
阅读次数:
143
批量替换脚本文件中的目录/proc,为/etc/init.d[root@mastercourse_04]#moretest.sh
#!/bin/bash
DIR=/proc
aa=`ls$DIR`
echo$aa验证是否全部修改完成
分类:
系统相关 时间:
2015-07-14 20:44:54
阅读次数:
243
实验服务器两台:192.168.77.189192.168.77.190服务器免密钥登录设置:[root@192_168_77_189~]#ssh-keygenGeneratingpublic/privatersakeypair.Enterfileinwhichtosavethekey(/root/.ssh/id_rsa):Enterpassphrase(emptyfornopassphrase):Entersamepassphraseagain:Youridentific..
分类:
系统相关 时间:
2015-07-08 00:41:20
阅读次数:
186
批量的创建用户,并对每个用户创建不同的密码;实例一:密码是随机数生成;#!/bin/bashrm-fuser.logforiin`seq-w515`dopass=`echo$RANDOM|md5sum|cut-c1-8`useradduser$i&&echo"$pass"|passwd--stdinuser$iecho-e"user:user$i\tpass:$pass">>user.logdone[root@t..
分类:
其他好文 时间:
2015-05-30 18:25:42
阅读次数:
296
shell
MegaCli的相关shell脚本
shell分析swap分区被哪些程序占用(stress模拟环境)
shell的单、多、控制进程
shell脚本日志清理和压缩
在shell脚本里显示带颜色的字(linux)
shell批量检查N个网站地址是否正常(debian/centos)
shellmuttmsmtp发邮件
shell脚本备份服务并上传
shel..
分类:
其他好文 时间:
2015-05-26 10:52:58
阅读次数:
186
rzrk:~/luzhi#ldconfig
ldconfig:/usr/local/lib/libsvn_fs_base-1.so.0isnotasymboliclink
ldconfig:/usr/local/lib/libcharset.so.1isnotasymboliclink
ldconfig:/usr/local/lib/libpcrecpp.so.0isnotasymboliclink
ldconfig:/usr/local/lib/libzookeeper_mt.so.2isnotasymbo..
分类:
系统相关 时间:
2015-05-05 12:46:20
阅读次数:
1165
批量更改文件名:1、在多个文件后面添加.bak或者其他有规律的字符ls|xargs-n1-i{}mv{}{}.bak或者find./*.txt-execmv{}{}_bak\;2、通用的批量更改脚本#!/bin/bash
read-p"oldextension:"oldext
read-p"newextension:"newext
read-p"Thedirectory:"dir
cd$dirforfilein$(ls$dir|g..
分类:
系统相关 时间:
2015-04-28 18:48:41
阅读次数:
198