File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Linux / UNIX and the fly likes Datewise File search Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "Datewise File search" Watch "Datewise File search" New topic

Datewise File search

SaurabhSri Sri
Ranch Hand

Joined: May 01, 2008
Posts: 43
Hi All,

I hae a need of a Unix shell script which prompt me to input "From" and "To" date (dd/mm/yyyy) format. When I press enter it should print all the file names modified between given dates. e.g.
Consider following list of files in a particular directory –

File Name Date Modified (dd/mm/yyyy)

a.txt 12/01/2009
b.txt 11/01/2009
c.txt 10/01/2009
d.txt 09/01/2009
e.txt 08/01/2009
f.txt 07/01/2009
g.txt 06/01/2009
h.txt 05/01/2009

If I input From date = 06/01/2009 And To date = 09/01/2009, Then output should be -


Thanks a lot For any help.

SaurabhSri (SCJP 1.5)
Peter Johnson

Joined: May 14, 2008
Posts: 5852

Please note that Java Ranch is not a code mill. Have you written anything so far? If so, what do you have working and what isn't working? Then someone might step up and help you get the broken part working.

JBoss In Action
Pat Farrell

Joined: Aug 11, 2007
Posts: 4659

In Unix/Linux, one generally would not write code to do this, as the 'find' command does it with zero programming.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 15092

Type 'man find' for information on how the 'find' command works.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
I agree. Here's the link:
subject: Datewise File search
jQuery in Action, 3rd edition