很实用的linux的搜索命令

来源:互联网 发布:js includes 编辑:程序博客网 时间:2024/06/06 06:20

sed -n '/openId:null/p' catalina.out     搜索文件catalina.out文件中的openId:null


sed -n '/for循环中的openId:null/p' sdey-2016-12-09.log | wc -l   搜索文件sdey-2016-12-09.log 文件中的 “for循环中的openId:null”  的个数


sed -n '/2017-01-02 15:00:*/,/2017-01-02 16:30:*/p' 日志位置 > 1.txt

sed -n '/2017-01-02 15:00:*/,/2017-01-02 16:30:*/p' /home/tomcat-7.0/logs/catalina.out > 1.txt  意思是把2017-01-02 15:00到2017-01-02 16:30 的日志打印导出1.txt里



0 0
原创粉丝点击