sed命令截取特定日期日志
时间:2014-12-19 14:01 来源:linux.it.net.cn 作者:IT
sed命令截取指定日期内日志文件的方法,sed命令用法例子。
文件内容格式:
*****
系统信息:Accessing Time:2013-03-22 09:24:12
系统信息:WebLogic WebService Accessing Success:DealFlowSub ()
*******
系统信息:Accessing Time:2013-03-22 09:34:10
系统信息:WebLogic WebService Accessing Success:DealFlowSub ()
需求:截取特定时间的内容,内容行数不确定。
shell语句:
sed -n '/Accessing Time:2013-03-18/,/Accessing Time:2013-03-19/'p nohup.out20130322 >18.txt
(责任编辑:IT)
sed命令截取指定日期内日志文件的方法,sed命令用法例子。
文件内容格式:
系统信息:Accessing Time:2013-03-22 09:34:10 需求:截取特定时间的内容,内容行数不确定。
shell语句:
sed -n '/Accessing Time:2013-03-18/,/Accessing Time:2013-03-19/'p nohup.out20130322 >18.txt
(责任编辑:IT) |