sudo apt-get update; sudo apt-get install some-tool; some-tool 说明: $? 环境变量 等同于 程序执行结果 linux 中,程序执行结果为 1 表示 未执行 ; 执行结果为 0 表示执行 $ which cowsay>/dev/null ...
分类:
系统相关 时间:
2017-06-10 23:39:01
阅读次数:
409
27使用mysqladmin关闭数据库mysqladmin-uroot-poldboy123shutdownps-ef|grepmysql28mysql忘记密码重新修改密码过程:mysql>mysqld_safe--skip-grant-tables--user=mysql--defaults-file=/data/3306/my.cnf>/dev/null&->mysqld_safe--skip-grant-tables--user=mysq..
分类:
数据库 时间:
2017-06-04 22:57:55
阅读次数:
325
history记录中添加时间,用户地址等信息vi/etc/profileexportHISTTIMEFORMAT="%F%T`who-uami2>/dev/null|awk‘{print$NF}‘|sed-e‘s/[()]//g‘``whoami`"history记录添加到syslog日志方法一:推荐vi/etc/profilefunctionlog2syslog{declareCOMMANDCOMMAND=$(fc-ln-0)logger-plo..
分类:
其他好文 时间:
2017-06-03 19:25:01
阅读次数:
361
使用shell函数实现监控web网站url[root@linux-node3scripts]#catcheckweb.sh
#!/bin/bash
functionusage(){
echo$"usage:$0url"
exit1
}
functioncheck_url(){
wget--spider-q-o/dev/null--tries=1-T5$1
if[$?-eq0]
then
echo"$1isyes."
else
echo"$1isno."
fi
}
functionmain(..
分类:
Web程序 时间:
2017-06-03 00:52:02
阅读次数:
172
要什么变量替换,直接复制粘贴,程序跑起来就走。#!/bin/bash#将hellodb的数据拷贝到hellodb_bak库里面。mysql-uroot-pAbcd@1234-h10.0.20.26-P33062>/dev/null-e"flushtableswithreadlock;"mysql-uroot-pAbcd@1234-h10.0.20.26-P33062>/dev/null-e"createdatabasehellod..
分类:
数据库 时间:
2017-06-01 16:50:04
阅读次数:
277
#!/bin/bash
#
#获取目标目录
target=/mnt/sysroot
#命令copy函数
cmndcopy(){
#假如命令不存在,return1
if!which$1&>/dev/null;then
return1
fi
#获取命令决定路径
cmnd=$(which--skip-alias$1)
#获取命令目录名
cmndpath=$(dirname$cmnd)
#判断命令目录名是否存在..
分类:
系统相关 时间:
2017-05-27 23:53:42
阅读次数:
195
一、安装前提 一、安装前提 (1) 安装好 LNMP 完整环境(2) Nginx 能够解析 PHP(3) 配置环境变量:echo 'export LC_ALL=C' >> /etc/profile && source /etc/profile 2> /dev/null(4) 安装 Perl 相关依赖 ...
分类:
系统相关 时间:
2017-05-26 15:56:19
阅读次数:
291
一、安装前提 (1) 安装好 LNMP 完整环境(2) Nginx 能够解析 PHP(3) 配置环境变量:echo 'export LC_ALL=C' >> /etc/profile && source /etc/profile 2> /dev/null(4) 安装 Perl 相关依赖:yum in ...
分类:
系统相关 时间:
2017-05-26 13:27:44
阅读次数:
386
一、安装前提 (1) 安装好 LNMP 完整环境(2) Nginx 能够解析 PHP(3) 配置环境变量:echo 'export LC_ALL=C' >> /etc/profile && source /etc/profile 2> /dev/null(4) 安装 Perl 相关依赖:yum in ...
分类:
其他好文 时间:
2017-05-26 13:18:37
阅读次数:
240
删除文件 rm 123.txt 删除目录 rm -rf 123 删除目录下的文件目录不删除 rm -rf 123/* 实时查看日志 tail -f test.log 清空日志 cat /dev/null > test.log 查看磁盘空间 df -lh 查看目录文件权限和大小 ls -l 修改密码 ...
分类:
系统相关 时间:
2017-05-24 22:45:50
阅读次数:
275