請問大神,比如以下日志資訊:
2020-10-24 01:55:28.415:
aaaaaaaaaa
2020-10-25 01:55:28.415:
bbbbbbbbbb
2020-10-26 01:55:28.415:
cccccccccc
2020-10-26 01:55:28.415:
[ctssd(6797)]CRS-2408:The clock on host
2020-10-26 02:26:24.702:
[ctssd(6797)]CRS-2408:The clock on host
2020-10-26 02:59:20.981:
[ctssd(6797)]CRS-2408:The clock on host
2020-10-26 03:32:33.281:
[ctssd(6797)]CRS-2408:The clock on host
2020-10-26 04:05:53.588:
[ctssd(6797)]CRS-2408:The clock on host
2020-10-26 04:39:13.904:
[ctssd(6797)]CRS-2408:The clock on host
查看日志檔案時,要將含“CRS-2408”的行以及上面一行日期過濾掉,只剩下:
2020-10-24 01:55:28.415:
aaaaaaaaaa
2020-10-25 01:55:28.415:
bbbbbbbbbb
2020-10-26 01:55:28.415:
cccccccccc
要怎么實作
uj5u.com熱心網友回復:
sed 'N;/\n.*CRS*/!P;D' logfile | grep -v CRS轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/192850.html
標籤:系統維護與使用區
下一篇:第一天-Linux的今生前世
