随笔分类 -  Shell

摘要:1. who 查看当前登录用户2. last查看历史登录用户3. history 查看历史执行命令4. cat /var/log/secure | grep -i "accepted password" 查看成功登录记录信息5. cat /var/log/secure | grep -i "fail 阅读全文
posted @ 2019-11-30 15:08 HarkLee 阅读(191) 评论(0) 推荐(0) 编辑
摘要:ps -aux netstat -anp 阅读全文
posted @ 2018-02-12 10:51 HarkLee 阅读(151) 评论(0) 推荐(0) 编辑
摘要:du -sh : 查看当前目录总共占的容量。而不单独列出各子项占用的容量 du -lh --max-depth=1 : 查看当前目录下一级子文件和子目录占用的磁盘容量。 阅读全文
posted @ 2018-01-19 08:10 HarkLee 阅读(410) 评论(0) 推荐(0) 编辑
摘要:30 22 * * * /usr/sbin/ntpdate 阅读全文
posted @ 2017-01-05 17:15 HarkLee 阅读(164) 评论(0) 推荐(0) 编辑
摘要:du -hs ./* 阅读全文
posted @ 2017-01-04 17:34 HarkLee 阅读(296) 评论(0) 推荐(0) 编辑
摘要:典型的,提供大量静态文件访问的web服务器,缓存服务器(如squid), 均要注意这个问题 网上的教程,大约只是简单说明了如何设置ulimit和file-max, 但并没有说清楚这两者之间的差别,让人一头雾水 1. file-max的含义 man proc,可得到file-max的描述: /proc 阅读全文
posted @ 2016-11-23 16:12 HarkLee 阅读(986) 评论(0) 推荐(0) 编辑
摘要:lsof -n |awk '{print $2}'|sort|uniq -c |sort -nr|more 阅读全文
posted @ 2016-11-23 15:33 HarkLee 阅读(3078) 评论(0) 推荐(0) 编辑
摘要:1、事因: 执行shell测试时,shell中rm -rf $path/* 变量$path为空,结果执行的命令是rm -rf / 事发时及时ctrl+c中断,导致只有/bin /boot目录删除 2、造成后果 大部分/bin下的shell命令无法执行,例如ls mkdir chmod tar ssh 阅读全文
posted @ 2016-09-19 17:58 HarkLee 阅读(9159) 评论(0) 推荐(1) 编辑
摘要:45 3 * * * setsid script -c /home/dlht/shell/coreBusiness/coreOpt.sh >> /home/dlht/logs/coreOpt/corOpt_$(date +\%Y\%m\%d).log 阅读全文
posted @ 2015-11-11 20:26 HarkLee 阅读(992) 评论(0) 推荐(0) 编辑
摘要:date="2015-09-23"enddate='2015-11-08'while [[ $date < $enddate ]] do date=`date -d "+1 day $date" +%Y-%m-%d` echo $datedone 阅读全文
posted @ 2015-11-09 17:36 HarkLee 阅读(226) 评论(0) 推荐(0) 编辑
摘要:使用setsid替代nohup使用 nohup 执行sudo -e时会有问题的。 阅读全文
posted @ 2015-09-30 11:34 HarkLee 阅读(1081) 评论(0) 推荐(0) 编辑
摘要:1、shell如何向python传递参数shell脚本python $sendmailCommandPath $optDatepython脚本lastDateFormat = sys.argv[1] shell如何接受python的返回值python脚本print "hello"shell脚本s=`... 阅读全文
posted @ 2015-09-08 10:21 HarkLee 阅读(794) 评论(0) 推荐(0) 编辑
摘要:文章来自:http://www.cnblogs.com/hark0623/p/4196381.html 转载请注明需要在你的脚本前面添加nohub,后边添加&。例如下面的脚本:nohup ./flume_client.sh &nohup的作用:当你的SecureCRT会话关闭后,保证你的脚本还在Li... 阅读全文
posted @ 2014-12-31 18:29 HarkLee 阅读(2757) 评论(0) 推荐(0) 编辑
摘要:文章发自:http://www.cnblogs.com/hark0623/p/4196355.html 转发请注明脚本如下find /opt/data/sensor -name "*.maclog" -exec 'cat' {} \; > /opt/data/sensor/1.txt 阅读全文
posted @ 2014-12-31 18:11 HarkLee 阅读(247) 评论(0) 推荐(0) 编辑

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