xmi
请教有没有快grep的方法
如何可以一次在文件中grep到想要的? 如下:
文件:abc_log
2008-06-30 02:00:00 power shutdown
2008-06-30 02:01:00 booting up .................
2008-06-30 03:15:12 server ready
2008-06-30 07:20:11 received B alert log
2008-06-30 07:30:20 received B client
2008-06-30 08:45:11 received B client log
2008-06-30 09:30:20 received E client
我只想取得2008-06-30, 由7时至9时的资料!
输出:
2008-06-30 07:20:11 received B alert log
2008-06-30 07:30:20 received B client
2008-06-30 08:45:11 received B client log
我只会用
1 cat abc_log |grep 07 > a
2 cat abc_log |grep 08 > b
3 cat a b > c
4 cat c |grep B > output
请问有没有快的方便? 谢谢.