linux cat获取时间段的日志,shell获取某个时间段的nginx日志内容

从nginx日志中获取2014:04:01日 21:30至21:50的日志内容

# cat web.log

192.168.16.105 - - [01/Apr/2014:21:26:21 +0800] "GET / HTTP/1.1" 502 172

192.168.16.105 - - [01/Apr/2014:21:28:22 +0800] "GET / HTTP/1.1" 502 172

192.168.16.105 - - [01/Apr/2014:21:31:36 +0800] "GET / HTTP/1.1" 502 172

192.168.16.105 - - [01/Apr/2014:21:42:14 +0800] "GET / HTTP/1.1" 502 172

192.168.16.105 - - [01/Apr/2014:21:45:22 +0800] "GET / HTTP/1.1" 502 172

192.168.16.105 - - [01/Apr/2014:21:46:32 +0800] "GET / HTTP/1.1" 502 172

192.168.16.105 - - [01/Apr/2014:21:46:54 +0800] "GET / HTTP/1.1" 502 172

192.168.16.105 - - [01/Apr/2014:21:47:03 +0800] "GET / HTTP/1.1" 502 172

192.168.16.105 - - [01/Apr/2014:21:48:31 +0800] "GET / HTTP/1.1" 200 26

192.168.16.105 - - [01/Apr/2014:21:50:08 +08

你可能感兴趣的:(linux,cat获取时间段的日志)