Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 06-16-2009, 02:47 AM   #1
Registered: Mar 2005
Posts: 54

Rep: Reputation: 15
finding files that were created before a certain date


I need to find files with certain names that were uploaded to the server from a certain date.

this is what I tried:
touch -d "18 may 2009 17:54:19" date_marker
find /home/mash -iregex '.*[^a-z0-9 \_\.\/\-].*'  -cnewer date_marker -ls
it seems to list files that were created before that date I specified.

I also tried:
find /home/mash -iregex '.*[^a-z0-9 \_\.\/\-].*' -mtime -30 -ls
find /home/mash -iregex '.*[^a-z0-9 \_\.\/\-].*' -ctime -30 -ls
but the above seems to list files that were modified or changed in the that period of time and not just the created ones.

I need only NEW files because that is how I know the date they were uploaded.

suggestions ?
Old 06-16-2009, 03:44 AM   #2
Registered: Nov 2008
Distribution: Linux Mint
Posts: 56

Rep: Reputation: 17
find format

Hey Basher,
the -cnewer flag seemed to work fine on Debian 5.0 I'm using, however I didn't use the iregex or ls flags.
Maybe try testing it without those flags just to be sure the -cnewer command is working right first?
Old 06-16-2009, 03:46 AM   #3
Registered: Sep 2007
Location: Las Vegas, NV
Distribution: Fedora / CentOS
Posts: 674
Blog Entries: 3

Rep: Reputation: 90
Does this help any?

[admiral@glitch test]$ find . ! -newer marker -ls
753675    4 -rw-rw-r--   1 admiral    admiral           0 Jun 15  2006 ./marker
753821    4 -rw-rw-r--   1 admiral    admiral           0 Jun  1  2006 ./first
[admiral@glitch test]$ find . -newer marker -ls
753674    8 drwxrwxr-x   2 admiral    admiral        4096 Jun 16 00:04 .
753920    4 -rw-rw-r--   1 admiral    admiral           0 Jun 30  2006 ./last


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Sort files under a folder by created date Kunsheng Programming 3 05-11-2009 05:58 AM
find out the files created on a particular date. ZAMO Linux - General 3 02-08-2008 02:38 AM
How to - list files that were created aftre certain date kaprasanna Linux - Newbie 2 12-10-2007 04:50 AM
ow do I delete all files which were created on a specific date marsguy Linux - General 9 08-21-2007 09:15 AM
Date interrogation for files created chunky Linux - General 2 08-03-2004 04:31 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:56 AM.

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