Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 04-16-2012
Registered User
 
Join Date: Dec 2011
Posts: 26
Thanks: 5
Thanked 0 Times in 0 Posts
Check number of files that were created before a date?

Hi all,

In a directory I have a lot of files created in history. However do I check the number of files that were created before a designated date?

Thanks
Sponsored Links
    #2  
Old 04-16-2012
Registered User
 
Join Date: Feb 2012
Location: Cornwall, UK
Posts: 407
Thanks: 7
Thanked 73 Times in 71 Posts
One way to do this would be "find ! -newer"

Most find commands (depending on your Unix/Linux) implement a -newer switch.


Code:
 
find . -newer <date point file> -print

The <date point file> is used as a reference of its inode contents for a date reference. All files newer than that are found.

By using a bang (!) in front of the switch you can invert the function meaning you will list all files older than the reference.

eg.


Code:
 
find . ! -newer <file> -print

Hope that helps.

Using commands you can also tweak the inode contents of your date reference file to produce a date/time of your choosing.
Sponsored Links
Closed Thread

Tags
count, date

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Showing files that were created at a certain Date jimas13 Shell Programming and Scripting 2 05-02-2011 04:35 AM
print out date of files last created?? new bie Shell Programming and Scripting 4 11-15-2010 12:42 AM
Remove files which created date before 10 days on HP-UX murad_fayez Shell Programming and Scripting 1 12-21-2008 05:05 AM
Display files created on particular date amit_kv1983 UNIX for Dummies Questions & Answers 6 04-24-2008 06:40 AM
Copying files created after a specified date/time jm6601 Shell Programming and Scripting 2 11-28-2007 12:29 PM



All times are GMT -4. The time now is 12:46 PM.