On 28Aug2007 16:08, Kaushal Shriyan kaushalshriyan@gmail.com wrote: | find . -name "url*.0" -mtime "Apr" | wc -l | | find: invalid argument `Apr' to `-mtime' | | I am looking out for the month of Apr only so how would the command -mtime | look like
The -mtime option takes _days_, not a date. Figure out how many days ago 01may2007 was, and how many days ago 01apr2007 way. Eg:
$ date +%j # today 241 $ date -d 2007-05-01 +%j 121 $ date -d 2007-04-01 +%j 091
So April lies between 120 and 150 days ago. So:
find . -name "url*.0" -mtime +120 -mtime -150
See "man date" and "man find" for details.
Cheers,