如何grep 2或3行,其中一行包含我想要的文本,而另一行仅位于文本下方?
这是错误日志的快照: 06:16:29,933 ERROR EmailRMManager$:45 - Exception In get Message com.rabbitmq.client.AlreadyClosedException: clean connection shutdown; reason: Attempt to use closed channel at com.rabbitmq.client.impl.AMQChannel.ensureIsOpen(AMQChannel.java:195) at com.rabbitmq.client.impl.AMQChannel.rpc(AMQChannel.java:222) at com.rabbitmq.client.impl.AMQChannel.rpc(AMQChannel.java:208) at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:139) at com.rabbitmq.client.impl.ChannelN.basicGet(ChannelN.java:645) 我执行以下命令: cat foo.log | grep ERROR 得到一个OP: 06:16:29,933 ERROR EmailRMManager$:45 - Exception In get Message 我应该执行什么命令来获得输出 06:16:29,933 ERROR EmailRMManager$:45 - Exception …