List all files created since a certain date.

Place to discuss Fedora and/or Red Hat

List all files created since a certain date.

Postby ZiaTioN » Tue Apr 27, 2004 1:25 pm

Is there an easy way to return all files created (not modified) in the last n days? I know I can do the following:

find / -mtime -15


to find all files either created or modified in the last 15 days but this does not excluisively return created files, it also returns modified files.
ZiaTioN
administrator
administrator
 
Posts: 460
Joined: Tue Apr 08, 2003 3:28 pm

Postby Void Main » Tue Apr 27, 2004 1:41 pm

-ctime?

EDIT: ctime is not what you want either (I knew that). I don't think you can actually do what you want with the "find" command. There is no separate entry for "creation" time. See man pages for "stat" and "fstat". Modifying a file is basically the same as creating a new one (which actually is often the case anyway when using apps like vi).
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby ZiaTioN » Wed Apr 28, 2004 10:56 am

Yeah, I already have come to the conclusiong that you would have to create an app that monitors your entire filesystem and logs a seperate entry for initial creation to accomplish this. But as you said these results would also be invalid when it come to apps like vi that create new files when an existing file is modified.

-mitime and -ctime will just have to do I guess.
ZiaTioN
administrator
administrator
 
Posts: 460
Joined: Tue Apr 08, 2003 3:28 pm


Return to Fedora/Red Hat

Who is online

Users browsing this forum: No registered users and 1 guest

cron