1.不提示删除目录 rm -rf ${dir}
2.rpm 查看并卸载软件
rpm -qa | grep ${appname}
rpm -e ${rpmname}
3.数学计算之bc
echo "3 + 4 - 5 * 5 - 7 " | bc
echo "3 + 4 - 5 * 5 - 7 " | bc | read myresult
4.查看进程
ps -ef | grep ${tname}
exp: ps -ef | grep java
ps -ef | grep mysql
5.启动/停止服务
service ${servername} start
service ${servername} stop
6.日志监控
tail -f $applog
7.文件查找
grep "${searchcxt}" ${file}
8.文件截取,内容替换,内容提取
替换 sed 's/abc/cde/g' $file
替换abc为cde
sed -n '1,20p' $file > $newfile 1-20行输出到信文件
sed功能很强大 建议google