首页 > 系统服务 > 详细

记录使用过的linux命令

时间:2015-10-28 00:04:25      阅读:178      评论:0      收藏:0      [点我收藏+]

1、grep "xxxxxx" -A 20 -B 20 logs/catalina.out >1.log  //把关键词前后20行重定向到1.log文件

2、tail --bytes=+4 in.xml > in.txt    //去掉隐藏的文件头符号    

3、grep -c "AAA" 1.txt    //统计单词数量

4、sudo vim /etc/sysconfig/iptables //查看iptables

sudo /etc/init.d/iptables restart

5、:%s/原内容/新内容/g    //全文替换

6、grep ‘<OTA_AirPriceRQ‘ rtLog | grep ‘Resource="TFR"‘ | grep -P -o ‘<Requestor Type="13".*?/>‘ >1.txt

grep -P -o ‘ID=".*"‘ 1.txt |sort |uniq -c|sort -n -k1    (-p使用poll表达式,-o正则  uniq分组)

grep -Eo ‘.* - -‘ ufeifan.access.log |sort|uniq -c|sort -n -k1 (uniq -c依赖拍完序数据;-E 正则表达式 -o only-matching)

7、nohup command > myout.txt 2>&1 &    //把错误当成标准输出到myout.txt文件下

使用 jobs 查看任务。使用 fg %n 关闭。




记录使用过的linux命令

原文:http://my.oschina.net/kyle1970/blog/522849

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!