原文內容:
[root@10 tmp]# more test.log
2019-12-01 09:09:02 Failed
2019-12-01 09:12:02 Failed
2019-12-01 09:15:03 Failed
2019-12-01 09:18:02 Failed
正則匹配Failed,刪除整行(直接替換文本內容)
[root@107 tmp] sed -i '/Failed$/'d check.log
原文內容:
[root@10 tmp]# more test.log
2019-12-01 09:09:02 Failed
2019-12-01 09:12:02 Failed
2019-12-01 09:15:03 Failed
2019-12-01 09:18:02 Failed
正則匹配Failed,刪除整行(直接替換文本內容)
[root@107 tmp] sed -i '/Failed$/'d check.log
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。