随笔 - 203  文章 - 11  评论 - 15  阅读 - 81万

随笔分类 -  shell

linux 使用 lockf命令防止脚本重复运行
摘要:之前服务器的脚本,迁移至一台新的机器上,运行脚本,提示报错信息:-bash: /usr/bin/lockf: 没有那个文件或目录 或-bash: /usr/bin/lockf: no such file or directory需要安装lockfLockf 安裝步骤下载:wget http://st... 阅读全文
posted @ 2015-08-19 13:13 mingaixin 阅读(1707) 评论(0) 推荐(0) 编辑
linux查找系统中占用磁盘空间最大的文件
摘要:Q:下午有一客户磁盘空间占用很大,使用df查看磁盘剩余空间很小了,客户想知道是哪些文件占满了文件。Q1:在Linux下如何查看系统占用磁盘空间最大的文件?Q2:在Linux下如何让文件夹下的文件让文件按大小排序?A:不知您是否遇到过这样的问题,服务器上架没多长时间磁盘怎么装满了。分析:大多是由于日志... 阅读全文
posted @ 2015-02-28 09:28 mingaixin 阅读(50908) 评论(0) 推荐(1) 编辑
linux sed 批量替换多个文件中的字符串
摘要:原文: http://blog.csdn.net/kauu/article/details/1757325一、linux sed 批量替换多个文件中的字符串sed -i "s/oldstring/newstring/g" `grep oldstring -rl yourdir`例如:替换/home下所有文件中的www.bcak.com.cn为bcak.com.cnsed -i "s/www.bcak.com.cn/bcak.com.cn/g" `grep www.bcak.com.cn -rl /home`自己做了实现测试一下,的确可以替换。 阅读全文
posted @ 2013-01-18 16:52 mingaixin 阅读(424) 评论(0) 推荐(0) 编辑
用shell脚本判断进程是否存在,并重新启动
摘要:#! /bin/bash# author caoxin# time 2012-10-10 # program : 判断进行是否存在,并重新启动function check(){ count=`ps -ef |grep $1 |grep -v "grep" |wc -l` #echo $count if [ 0 == $count ];then nohup python /runscript/working/$1 & fi}check behaviors.py参考的网址为: http://blog.csdn.net/shangpusp/arti... 阅读全文
posted @ 2012-10-11 11:25 mingaixin 阅读(15531) 评论(0) 推荐(1) 编辑

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示