Hi,
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
Thanks and Regards
Kaushal
Kaushal Shriyan wrote:
Hi,
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
Thanks and Regards
Kaushal
Hi Kashal,
the man page says: -mtime n File's data was last modified n*24 hours ago. See the comments for -atime to understand how rounding affects the interpretation of file modification times.
find . -name "url*.0" -atime "Apr" | wc -l find: invalid argument `Apr' to `-atime' 0
On 8/28/07, Joachim Backes joachim.backes@rhrk.uni-kl.de wrote:
Kaushal Shriyan wrote:
Hi,
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
Thanks and Regards
Kaushal
Hi Kashal,
the man page says: -mtime n File's data was last modified n*24 hours ago. See the comments for -atime to understand how rounding affects the interpretation of file modification times.
-- Joachim Backes joachim.backes@rhrk.uni-kl.de University of Kaiserslautern,Computer Center [RHRK], Systems and Operations, High Performance Computing, D-67653 Kaiserslautern, PO Box 3049, Germany
Phone: +49-631-205-2438, FAX: +49-631-205-3056 http://hlrwm.rhrk.uni-kl.de/home/staff/backes.html
-- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
On Tue, Aug 28, 2007 at 04:17:59PM +0530, Kaushal Shriyan wrote:
find . -name "url*.0" -atime "Apr" | wc -l find: invalid argument `Apr' to `-atime' 0
Hello Kaushal, maybe your looking for something like find . -name "url*.0" -ls |grep Apr |wc -l
Cheers, ku
Kaushal Shriyan wrote:
find . -name "url*.0" -atime "Apr" | wc -l find: invalid argument `Apr' to `-atime'
the options -atime, -mtime etc. do not accept an argument of the type "Apr", so you cannot do what you want in this way. These arguments expect an integer, which specifies the age of the file in days or minutes. See man find for more info, or
http://www.softpanorama.org/Tools/Find/find_mini_tutorial.shtml
Chris
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,