Jan 19, 2004 #1 vdsouza Programmer Oct 17, 2002 16 GB How do i find a file on the same day and that has been modified between a particular time period. For example. I wish to find a file today i.e. 19 th Jan between 0900 and 1700 hours.
How do i find a file on the same day and that has been modified between a particular time period. For example. I wish to find a file today i.e. 19 th Jan between 0900 and 1700 hours.
Jan 19, 2004 1 #2 aigles Technical User Sep 20, 2001 464 FR You can try something like this : # Create file with creation date today 09:00 touch -t `date +'%Y%m%d0900'` /tmp/from_date # Create file with creation date today 17:00 touch -t `date +'%Y%m%d1700'` /tmp/to_date # Find files created after 09:00 (from_date) # and not after 17:00 (to_file) find . -newer /tmp/from_date -a ! -newer /tmp/to_date -print # Delete work files rm /tmp/from_date /tmp/to_date Jean Pierre. Upvote 0 Downvote
You can try something like this : # Create file with creation date today 09:00 touch -t `date +'%Y%m%d0900'` /tmp/from_date # Create file with creation date today 17:00 touch -t `date +'%Y%m%d1700'` /tmp/to_date # Find files created after 09:00 (from_date) # and not after 17:00 (to_file) find . -newer /tmp/from_date -a ! -newer /tmp/to_date -print # Delete work files rm /tmp/from_date /tmp/to_date Jean Pierre.