LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux > Linux - Newbie
User Name
Password
Linux - Newbie This 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
 
Thread Tools
Old 09-10-2004, 03:27 PM   #1
mystique98ls
LQ Newbie
 
Registered: Sep 2004
Distribution: RedHat 6.2
Posts: 13
Thanked: 0
How to List files between date1 and date2 (range of time)?


[Log in to get rid of this advertisement]
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
mystique98ls is offline     Reply With Quote
Old 09-10-2004, 04:53 PM   #2
btmiller
Senior Member
 
Registered: May 2004
Distribution: At home: Kubuntu, Slackware, *BSD, Solaris. At work: Red Hat, CentOS, Debian, Fedora, Irix, HPUX
Posts: 3,341
Thanked: 8
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.
btmiller is offline     Reply With Quote


Old 09-10-2004, 05:36 PM   #3
mystique98ls
LQ Newbie
 
Registered: Sep 2004
Distribution: RedHat 6.2
Posts: 13
Thanked: 0

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

Thanks again.
mystique98ls is offline     Reply With Quote



Reply

Bookmarks


Thread Tools

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 05:56 AM
list file creation time allelopath Linux - General 2 08-02-2005 10:02 PM
copying a range of files maginotjr Linux - General 3 07-27-2005 07:58 PM
Most efficient way to list files changed since a specific time dman65 Linux - General 4 04-07-2005 01:52 PM
Cannot view list of users at this time. Wolverine Linux - Networking 6 10-20-2001 08:05 AM


All times are GMT -5. The time now is 09:27 PM.

Main Menu
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
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration