问题
I have multiple files which have raw CDRs in them. The files are named in the pattern cdr.log-2013-06-08-0100
. There are multiple files like so:
cdr.log-2013-06-07-0000
cdr.log-2013-06-07-0100
.
.
cdr.log-2013-06-08-2200
cdr.log-2013-06-08-2300
I need to grep
out a string from a range of files say between the date 6th june 2013 to 9th june 2013, how can I accomplish this?
回答1:
To grep
a string from specific range
of file.
find . -regex ".*cdr\.log-2013-06-0[6-9]-.*" -exec grep 'your string' {} +
来源:https://stackoverflow.com/questions/16998003/grep-from-a-range-of-dates-as-filenames