Re: find command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 28Aug2007 16:08, Kaushal Shriyan <kaushalshriyan@xxxxxxxxx> 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,
-- 
Cameron Simpson <cs@xxxxxxxxxx> DoD#743
http://www.cskk.ezoshosting.com/cs/

You need a brain the size of a melon to take it [the Isle of Man TT course]
all in and one the size of a walnut to actually race it.        - Peter Salmon

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux