答案1:The shell is a typical Unix program. It reads commands from the standard input and prints something on the standard output. This is simple and goo...
分类:
其他好文 时间:
2014-06-27 16:12:37
阅读次数:
260
一、卸载原来的mysql: 卸载一: 输入: #rpm -qa | grep -i mysql 显示: mysql-libs-5.1.52-1.el6_0.1.i686 卸载方法: yum -y remove mysql-libs-5.1.52-1.el6_0....
分类:
数据库 时间:
2014-06-27 15:54:30
阅读次数:
253
生活在 Bash shell 中,熟记以下快捷键,将极大的提高你的命令行操作效率。编辑命令Ctrl + a :移到命令行首Ctrl + e :移到命令行尾Ctrl + f :按字符前移(右向)Ctrl + b :按字符后移(左向)Alt + f :按单词前移(右向)Alt + b :按单词后移(左向...
分类:
其他好文 时间:
2014-06-27 15:08:30
阅读次数:
139
温馨提示 首先要安装postfix 或者 sendmail 等邮件服务器1.Apache#!/bin/bash#apache.shnc -w2 localhost 80 if[ $? -ne 0 ]then echo "apache is down,please check" | mail us.....
分类:
其他好文 时间:
2014-06-27 15:03:59
阅读次数:
256
如果你想查看所有进程的内存使用情况,可以使用命令procrank、dumpsys meminfo查看,当然也只可以过滤出某个进程如:dumpsys meminfo | grep -i phone
先来看下procrank
sh-4.2# procrank
PID Vss Rss Pss Uss cmdline
1078 59840K 59...
分类:
移动开发 时间:
2014-06-27 09:16:30
阅读次数:
603
#!/bin/bashsed-n‘/01/,/02/p‘y.log>01.txtsed-n‘/02/,/03/p‘y.log>02.txtsed-n‘/03/,/04/p‘y.log>03.txt#截取y.log文件中从文字01到02之间的内容到文件01.txt中。下同。这个不是按行截取,而是跟据字的内容来截龋
分类:
其他好文 时间:
2014-06-27 07:01:07
阅读次数:
130
Linux下Shell脚本输出带颜色文字文本终端的颜色可以使用“ANSI非常规字符序列”来生成。举例:"echo-e\033[44;37;5mBLUE\033[0m""echo-e\033[44;37;5mBLUE\033[0mBLACK"需要修改的地方是红色带下划线的部分,其中[***m部分的内容换成下面的数字,后面的内容是自己想要上色的内..
分类:
系统相关 时间:
2014-06-27 06:37:51
阅读次数:
429
要求1:使用for循环在/root/scripts/practice/q1/oldboy目录下创建十个文件.名称依次为:oldboy-1,oldboy-2,.....oldboy-10.脚本实现:#!/bin/bash
#Question1
shopt-sexpand_aliases
aliasll="ls-l"
cd/root/scripts/practice/q1
#首先判断目录是否存在,不存在则创建目录
if[!..
分类:
其他好文 时间:
2014-06-27 06:29:22
阅读次数:
415
获取指定域名的IP地址:#!/bin/bash
if[$#-lt1];then
echo$0needaparameter
exit0
fi
ADDR=$1
TMPSTR=`ping${ADDR}-c1|sed‘1{s/.*(\([^]*\))56.*/\1/;q}‘`
#TMPSTR=`ping${ADDR}-c1|sed‘1{s/[^(]*(//;s/).*//;q}‘`
echo${TMPSTR}
分类:
其他好文 时间:
2014-06-27 06:17:08
阅读次数:
928
系统环境:[root@salt_serverhome]#ifconfigeth0|grep"inetaddr:"|awk-F:‘{print$2}‘|awk‘{print$1}‘
192.168.100.228
[root@salt_serverhome]#cat/etc/redhat-release
CentOSrelease6.3(Final)
[root@salt_serverhome]#uname-r
2.6.32-279.el6.x86_64
[root@salt_serverhome]#..
分类:
其他好文 时间:
2014-06-27 06:12:03
阅读次数:
311