LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-10-2004, 02:27 PM   #1
mystique98ls
LQ Newbie
 
Registered: Sep 2004
Distribution: RedHat 6.2
Posts: 13

Rep: Reputation: 0
How to List files between date1 and date2 (range of time)?


Hi,

Could someone suggest how to list files created between two specified times (eg between Aug 10th 10:23 and Aug 12th 12:33)? I actually want to delete the bunch of files between such specific times. Please help.

Thanks,
PS
 
Old 09-10-2004, 03:53 PM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
Created or last accessed? Created will be impossible since inodes don't store file reation time, just access time, modification time, and status change time[1]. Read the man page to find, something like:

find . -mtime +10 -mtime -20

will print out a list of files modified between 10 and twenty days ago; add the appropriate -exec switch to remove them (be careful it's working right before doing this!) and you're set.

[1] Status change time is often the creation time, but it can't be relied on.
 
Old 09-10-2004, 04:36 PM   #3
mystique98ls
LQ Newbie
 
Registered: Sep 2004
Distribution: RedHat 6.2
Posts: 13

Original Poster
Rep: Reputation: 0
Thanks for the command info. I used : rm $(find .... )
to delete the files between specific times and it worked good.

Thanks again.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to list file space usage estimate (du), SPECIFIED BY RANGE tsilok Linux - Newbie 6 10-24-2005 04:56 AM
list file creation time allelopath Linux - General 2 08-02-2005 09:02 PM
copying a range of files maginotjr Linux - General 3 07-27-2005 06:58 PM
Most efficient way to list files changed since a specific time dman65 Linux - General 4 04-07-2005 12:52 PM
Cannot view list of users at this time. Wolverine Linux - Networking 6 10-20-2001 07:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration